[RFD] does abi of sysfs of gpio change?

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

 



Hi, guys

I am working on writing a gpio mockup driver(for test the gpio framework).
I found that in the lastest for-next branch of linux-gpio, the path of gpiochip
in device directory is changed from
`/sys/devices/platform/gpio-mockup/gpio/gpiochip*`
to
`/sys/devices/platform/gpio-mockup/gpiochip*/gpio`.

And secondly, the name of gpiochip in the devices directory is changed from
gpiochipBASE to gpiochipSEQ, e.g. there are two gpiochip([0,31],[32,63]) in my
device. It changed from
`/sys/devices/platform/gpio-mockup/gpio/gpiochip0`
`/sys/devices/platform/gpio-mockup/gpio/gpiochip32`
to
`/sys/devices/platform/gpio-mockup/gpiochip0/gpio`
`/sys/devices/platform/gpio-mockup/gpiochip1/gpio`

IIUC, this change may break the script which depend on it.
Is it intended to do it?

And it could be fix by reverting one line from commit 5031fbdf5365
("gpio: move sysfs mock device to the gpio_device").

Regards

Bamvor

>From be7699ddea0fd0e2b0712cc8f50318595cad553c Mon Sep 17 00:00:00 2001
From: Bamvor Jian Zhang <bamvor.zhangjian@xxxxxxxxxx>
Date: Wed, 24 Feb 2016 22:17:19 +0800
Subject: [PATCH] fix abi changes of sysfs

Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@xxxxxxxxxx>
---
drivers/gpio/gpiolib-sysfs.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/gpio/gpiolib-sysfs.c b/drivers/gpio/gpiolib-sysfs.c
index c563094..db39464 100644
--- a/drivers/gpio/gpiolib-sysfs.c
+++ b/drivers/gpio/gpiolib-sysfs.c
@@ -721,6 +721,7 @@ EXPORT_SYMBOL_GPL(gpiod_unexport);
int gpiochip_sysfs_register(struct gpio_device *gdev)
{
   struct device   *dev;
+   struct device   *parent;
   struct gpio_chip *chip = gdev->chip;

   /*
@@ -733,7 +734,12 @@ int gpiochip_sysfs_register(struct gpio_device *gdev)
       return 0;

   /* use chip->base for the ID; it's already known to be unique */
-   dev = device_create_with_groups(&gpio_class, &gdev->dev,
+   if (chip->parent)
+       parent = chip->parent;
+   else
+       parent = &gdev->dev;
+
+   dev = device_create_with_groups(&gpio_class, parent,
                   MKDEV(0, 0),
                   chip, gpiochip_groups,
                   "gpiochip%d", chip->base);
--
2.6.2
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux