summaryrefslogtreecommitdiff
path: root/drivers/gpio
diff options
context:
space:
mode:
authorWang Qing <wangqing@vivo.com>2020-06-12 16:05:45 +0800
committerBartosz Golaszewski <bgolaszewski@baylibre.com>2020-06-15 10:07:49 +0200
commit97cd738c44c85680d6c37f8583409ad2ef0ea17b (patch)
tree16bc39996a26b1ec16695c8b7adb7fd1f433164f /drivers/gpio
parente012d15a238f24795081ef1e43ffe2859b6538ed (diff)
gpiolib: sysfs: use kobj_to_dev
Use kobj_to_dev() API instead of container_of(). Signed-off-by: Wang Qing <wangqing@vivo.com> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/gpiolib-sysfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpio/gpiolib-sysfs.c b/drivers/gpio/gpiolib-sysfs.c
index 23e3d335cd54..82371fe2ccc6 100644
--- a/drivers/gpio/gpiolib-sysfs.c
+++ b/drivers/gpio/gpiolib-sysfs.c
@@ -365,7 +365,7 @@ static DEVICE_ATTR_RW(active_low);
static umode_t gpio_is_visible(struct kobject *kobj, struct attribute *attr,
int n)
{
- struct device *dev = container_of(kobj, struct device, kobj);
+ struct device *dev = kobj_to_dev(kobj);
struct gpiod_data *data = dev_get_drvdata(dev);
struct gpio_desc *desc = data->desc;
umode_t mode = attr->mode;