RE: [PATCH 1/3] misc: enclosure: remove get_active() callback

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Mariusz Tkaczyk wrote:
> The callback is not used, remove it.

While the callback is not used, userspace might still be dependent upon
on the "active" attribute being readable. So I think the change would be
limited to:

diff --git a/drivers/misc/enclosure.c b/drivers/misc/enclosure.c
index 4ba966529458..0d7225dc5d45 100644
--- a/drivers/misc/enclosure.c
+++ b/drivers/misc/enclosure.c
@@ -534,11 +534,8 @@ 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);
        return sysfs_emit(buf, "%d\n", ecomp->active);
 }
 
...unless you can prove that userspace never reads "active", but I
expect it is too late to make a breaking change like that.



[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux