[PATCH v3 1/2] misc: enclosure: remove get_active callback

Mariusz Tkaczyk posted 2 patches 2 years, 8 months ago
[PATCH v3 1/2] misc: enclosure: remove get_active callback
Posted by Mariusz Tkaczyk 2 years, 8 months ago
The callback is not used, remove it. Leave possibility to read cached
ecomp->active value.

Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
---
 drivers/misc/enclosure.c  | 4 +---
 include/linux/enclosure.h | 2 --
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/misc/enclosure.c b/drivers/misc/enclosure.c
index 1b010d9267c9..59704fdb962a 100644
--- a/drivers/misc/enclosure.c
+++ b/drivers/misc/enclosure.c
@@ -534,11 +534,9 @@ static ssize_t set_component_status(struct device *cdev,
 static ssize_t get_component_active(struct device *cdev,
 				    struct device_attribute *attr, char *buf)
 {
-	struct enclosure_device *edev = to_enclosure_device(cdev->parent);
 	struct enclosure_component *ecomp = to_enclosure_component(cdev);
 
-	if (edev->cb->get_active)
-		edev->cb->get_active(edev, ecomp);
+	/* The value may have been updated by edev->cb->set_active(). */
 	return sysfs_emit(buf, "%d\n", ecomp->active);
 }
 
diff --git a/include/linux/enclosure.h b/include/linux/enclosure.h
index 1c630e2c2756..8d09c6d07bf1 100644
--- a/include/linux/enclosure.h
+++ b/include/linux/enclosure.h
@@ -62,8 +62,6 @@ struct enclosure_component_callbacks {
 	int (*set_fault)(struct enclosure_device *,
 			 struct enclosure_component *,
 			 enum enclosure_component_setting);
-	void (*get_active)(struct enclosure_device *,
-			   struct enclosure_component *);
 	int (*set_active)(struct enclosure_device *,
 			  struct enclosure_component *,
 			  enum enclosure_component_setting);
-- 
2.26.2
Re: [PATCH v3 1/2] misc: enclosure: remove get_active callback
Posted by Christoph Hellwig 2 years, 8 months ago
Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>
Re: [PATCH v3 1/2] misc: enclosure: remove get_active callback
Posted by Mariusz Tkaczyk 2 years, 7 months ago
On Tue, 30 May 2023 16:36:11 +0200
Christoph Hellwig <hch@lst.de> wrote:

> Looks good:
> 
> Reviewed-by: Christoph Hellwig <hch@lst.de>

Hi Arnd,
Gentle reminder. Could you please take a look?
When I can expect it to be merged?

I'm working on the NPEM extension to enclosure services which is based on those
changes.

Thanks,
Mariusz