[v2,1/2] misc: enclosure: remove get_active callback
Commit Message
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(-)
Comments
On Wed, May 24, 2023 at 01:12:30PM +0200, Mariusz Tkaczyk wrote:
> + /* The value of ecomp->active may have been updated by edev->cb->set_active(). */
Please don't write overly long comment lines.
@@ -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 of ecomp->active may have been updated by edev->cb->set_active(). */
return sysfs_emit(buf, "%d\n", ecomp->active);
}
@@ -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);