]> git.baikalelectronics.ru Git - kernel.git/commit
nvme-hwmon: rework to avoid devm allocation
authorHannes Reinecke <hare@suse.de>
Tue, 19 Jan 2021 06:43:18 +0000 (07:43 +0100)
committerChristoph Hellwig <hch@lst.de>
Wed, 10 Feb 2021 15:38:06 +0000 (16:38 +0100)
commita4d2da7b772bc6c4723fa59562875430dacc072a
tree0e2c21bda36e81b9c7dbbb23b8522f9ed70c5916
parent72fb96890bbf17d87d9580ba3841afbac9bc1745
nvme-hwmon: rework to avoid devm allocation

The original design to use device-managed resource allocation
doesn't really work as the NVMe controller has a vastly different
lifetime than the hwmon sysfs attributes, causing warning about
duplicate sysfs entries upon reconnection.
This patch reworks the hwmon allocation to avoid device-managed
resource allocation, and uses the NVMe controller as parent for
the sysfs attributes.

Cc: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Tested-by: Enzo Matsumiya <ematsumiya@suse.de>
Tested-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/core.c
drivers/nvme/host/hwmon.c
drivers/nvme/host/nvme.h