[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220317141539.GD64706@ziepe.ca>
Date: Thu, 17 Mar 2022 11:15:39 -0300
From: Jason Gunthorpe <jgg@...pe.ca>
To: Mika Penttilä <mpenttil@...hat.com>
Cc: linux-kernel@...r.kernel.org, linux-mm@...ck.org,
apopple@...dia.com, jhubbard@...dia.com, rcampbell@...dia.com,
vbabka@...e.cz
Subject: Re: [PATCH v2] mm/hmm/test: simplify hmm test code: use miscdevice
instead of char dev
On Thu, Mar 17, 2022 at 08:58:52AM +0200, Mika Penttilä wrote:
> @@ -1225,7 +1232,11 @@ static int dmirror_device_init(struct dmirror_device
> *mdevice, int id)
>
> cdev_init(&mdevice->cdevice, &dmirror_fops);
> mdevice->cdevice.owner = THIS_MODULE;
> - ret = cdev_add(&mdevice->cdevice, dev, 1);
> + device_initialize(&mdevice->device);
> + dev_set_name(&mdevice->device, "%s", dmirror_device_names[id]);
> + mdevice->device.devt = dev;
> +
> + ret = cdev_device_add(&mdevice->cdevice, &mdevice->device);
> if (ret)
> return ret;
Right, miscdev isn't that helpful in the end..
Jason
Powered by blists - more mailing lists