[PATCH] NVMe:Expose model attribute in sysfs

Keith Busch keith.busch at intel.com
Tue Aug 25 10:14:39 PDT 2015


On Mon, 24 Aug 2015, Sujith Pandel wrote:
> +	result = device_create_file(dev->device, &dev_attr_model);
> +	if (result) {
> +		device_remove_file(dev->device, &dev_attr_reset_controller);
> +		goto put_dev;
> +	}

This isn't a very maintainable way to unwind on failure. A new label to
'goto' would be better.

But if we're going to have more than one sysfs entry, we can manage
this easier using attribute groups instead. There are lots of examples
in the kernel for this, like scsi_sysfs.c or blk-mq-sysfs.c



More information about the Linux-nvme mailing list