From: gregkh@linuxfoundation.org (Greg Kroah-Hartman)
Subject: [PATCH v2 1/4] MicroSemi Switchtec management interface driver
Date: Fri, 10 Feb 2017 17:55:50 +0100 [thread overview]
Message-ID: <20170210165550.GA23959@kroah.com> (raw)
In-Reply-To: <ca970e7a-b062-d351-9a04-49a9e05955b5@deltatee.com>
On Fri, Feb 10, 2017@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@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
next prev parent reply other threads:[~2017-02-10 16:55 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-02 18:05 [PATCH v2 0/4] New Microsemi PCI Switch Management Driver Logan Gunthorpe
2017-02-02 18:06 ` [PATCH v2 1/4] MicroSemi Switchtec management interface driver Logan Gunthorpe
2017-02-10 14:51 ` Greg Kroah-Hartman
2017-02-10 16:48 ` Logan Gunthorpe
2017-02-10 16:55 ` Greg Kroah-Hartman [this message]
2017-02-10 17:03 ` Logan Gunthorpe
2017-02-10 17:09 ` Greg Kroah-Hartman
2017-02-10 18:00 ` Logan Gunthorpe
2017-02-10 17:57 ` [PATCH] switchtec: cleanup cdev init Logan Gunthorpe
2017-02-18 20:22 ` Logan Gunthorpe
2017-02-19 21:43 ` Dan Williams
2017-02-20 4:22 ` Logan Gunthorpe
2017-02-21 18:37 ` Jason Gunthorpe
2017-02-10 14:54 ` [PATCH v2 1/4] MicroSemi Switchtec management interface driver Greg Kroah-Hartman
2017-02-24 0:35 ` Bjorn Helgaas
2017-02-24 18:32 ` Logan Gunthorpe
2017-02-02 18:06 ` [PATCH v2 2/4] switchtec: Add user interface documentation Logan Gunthorpe
2017-02-02 18:06 ` [PATCH v2 3/4] switchtec: Add sysfs attributes to the Switchtec driver Logan Gunthorpe
2017-02-10 14:54 ` Greg Kroah-Hartman
2017-02-23 22:43 ` Bjorn Helgaas
2017-02-23 22:56 ` Logan Gunthorpe
2017-02-24 22:45 ` Bjorn Helgaas
2017-02-02 18:06 ` [PATCH v2 4/4] switchtec: Add IOCTLs " Logan Gunthorpe
2017-02-09 23:16 ` [PATCH v2 0/4] New Microsemi PCI Switch Management Driver Wei Zhang
2017-02-09 23:46 ` Wei Zhang
2017-02-10 14:54 ` Greg Kroah-Hartman
2017-02-10 16:14 ` Jens Axboe
2017-02-17 20:36 ` Logan Gunthorpe
2017-02-23 20:36 ` Logan Gunthorpe
2017-02-23 20:51 ` Sinan Kaya
2017-02-23 20:54 ` Jens Axboe
2017-02-23 20:56 ` Logan Gunthorpe
2017-02-23 20:52 ` Jens Axboe
2017-02-23 20:55 ` Greg Kroah-Hartman
2017-02-23 22:14 ` Bjorn Helgaas
2017-02-23 22:19 ` Logan Gunthorpe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170210165550.GA23959@kroah.com \
--to=gregkh@linuxfoundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox