[PATCH] NVMe:Expose model attribute in sysfs

Keith Busch keith.busch at intel.com
Tue Sep 8 14:29:54 PDT 2015


On Thu, 3 Sep 2015, Sujith Pandel wrote:
> :) Appreciate the way you and David are making me (a kernel newbie) interested to contribute more on this one.
> Hoping that this turns out to be my first kernel-patch!

Ha, I was only half-serious and would have submitted an attribute group
clean-up on the next sysfs I need to propose, but this looks pretty
good! :)

I'm wondering why you chose to add the device model number to sysfs since
this is available via other methods. Is it to maintain parity with scsi?

> +       result = nvme_create_sysfs_files(dev->device);
>        if (result)
>                goto put_dev;
>
> @@ -3208,6 +3246,7 @@ static int nvme_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>        return 0;
>
>  put_dev:
> +       nvme_remove_sysfs_files(dev->device);

You don't need to remove the sysfs files if creating them was not
successful, so you shouldn't have to add this to the error out at this
label. We'd need to add a new label with this in the future if the driver
performs more tasks that could potentially fail, but this is the last
thing this section of code does, so no need to unwind this.




More information about the Linux-nvme mailing list