Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1578618
| From | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v2 1/4] MicroSemi Switchtec management interface driver |
| Date | 2017-02-10 18:00 +0100 |
| Message-ID | <t9mIa-5ZB-17@gated-at.bofh.it> (permalink) |
| References | <t6tZw-7qr-15@gated-at.bofh.it> <t6tZv-7qr-13@gated-at.bofh.it> <t9kQ2-4Jf-21@gated-at.bofh.it> <t9mI9-5ZB-9@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Fri, Feb 10, 2017 at 09:48:37AM -0700, Logan Gunthorpe wrote:
> Hey Greg,
>
> Thanks so much for the review.
>
> On 10/02/17 07:51 AM, Greg Kroah-Hartman wrote:
> > On Thu, Feb 02, 2017 at 11:06:00AM -0700, Logan Gunthorpe wrote:
> >> + cdev = &stdev->cdev;
> >> + cdev_init(cdev, &switchtec_fops);
> >> + cdev->owner = THIS_MODULE;
> >> + cdev->kobj.parent = &dev->kobj;
> >
> > Minor nit, the kobject in a cdev is unlike any other kobject you have
> > ever seen, don't mess with it, it's not doing anything like you think it
> > is doing. So no need to set the parent field.
>
> Ok, that makes sense. I'll do a v3 shortly.
>
> I copied this from drivers/dax/dax.c so when I have a spare moment I'll
> submit a patch to remove it from there as well.
>
> Just to make sure I get this right without extra churn: does this look
> correct?
>
>
> cdev = &stdev->cdev;
> cdev_init(cdev, &switchtec_fops);
> cdev->owner = THIS_MODULE;
>
> rc = cdev_add(&stdev->cdev, dev->devt, 1);
> if (rc)
> goto err_cdev;
>
> dev = &stdev->dev;
> dev->devt = MKDEV(MAJOR(switchtec_devt), minor);
> dev->class = switchtec_class;
> dev->parent = &pdev->dev;
> dev->groups = switchtec_device_groups;
> dev->release = stdev_release;
> dev_set_name(dev, "switchtec%d", minor);
>
> rc = device_register(dev);
> if (rc) {
> cdev_del(&stdev->cdev);
> put_device(dev);
> return ERR_PTR(rc);
> }
>
Yes, but try it yourself to verify it really is correct :)
And it can just be an add-on patch, no need to respin a whole new
version for just that simple change, it doesn't hurt anything as-is,
it's just "not needed".
thanks,
greg k-h
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v2 0/4] New Microsemi PCI Switch Management Driver Logan Gunthorpe <logang@deltatee.com> - 2017-02-02 19:10 +0100
[PATCH v2 1/4] MicroSemi Switchtec management interface driver Logan Gunthorpe <logang@deltatee.com> - 2017-02-02 19:10 +0100
Re: [PATCH v2 1/4] MicroSemi Switchtec management interface driver Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-02-10 16:00 +0100
Re: [PATCH v2 1/4] MicroSemi Switchtec management interface driver Logan Gunthorpe <logang@deltatee.com> - 2017-02-10 18:00 +0100
Re: [PATCH v2 1/4] MicroSemi Switchtec management interface driver Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-02-10 18:00 +0100
Re: [PATCH v2 1/4] MicroSemi Switchtec management interface driver Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-02-10 18:20 +0100
Re: [PATCH v2 1/4] MicroSemi Switchtec management interface driver Logan Gunthorpe <logang@deltatee.com> - 2017-02-10 19:10 +0100
Re: [PATCH v2 1/4] MicroSemi Switchtec management interface driver Logan Gunthorpe <logang@deltatee.com> - 2017-02-10 19:00 +0100
[PATCH] switchtec: cleanup cdev init Logan Gunthorpe <logang@deltatee.com> - 2017-02-10 19:10 +0100
Re: [PATCH v2 1/4] MicroSemi Switchtec management interface driver Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-02-10 16:00 +0100
[PATCH v2 3/4] switchtec: Add sysfs attributes to the Switchtec driver Logan Gunthorpe <logang@deltatee.com> - 2017-02-02 19:10 +0100
Re: [PATCH v2 3/4] switchtec: Add sysfs attributes to the Switchtec driver Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-02-10 16:00 +0100
[PATCH v2 2/4] switchtec: Add user interface documentation Logan Gunthorpe <logang@deltatee.com> - 2017-02-02 19:10 +0100
[PATCH v2 4/4] switchtec: Add IOCTLs to the Switchtec driver Logan Gunthorpe <logang@deltatee.com> - 2017-02-02 19:10 +0100
Re: [PATCH v2 0/4] New Microsemi PCI Switch Management Driver Wei Zhang <wzhang@fb.com> - 2017-02-10 00:20 +0100
Re: [PATCH v2 0/4] New Microsemi PCI Switch Management Driver Wei Zhang <wzhang@fb.com> - 2017-02-10 00:50 +0100
Re: [PATCH v2 0/4] New Microsemi PCI Switch Management Driver Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-02-10 16:00 +0100
Re: [PATCH v2 0/4] New Microsemi PCI Switch Management Driver Jens Axboe <axboe@kernel.dk> - 2017-02-10 17:20 +0100
csiph-web