Signed-off-by: Logan Gunthorpe <[email protected]>
---
 drivers/gpio/gpiolib.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index a07ae9e..04dbc4a 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -1036,9 +1036,8 @@ static int gpiochip_setup_dev(struct gpio_device *gdev)
 
        cdev_init(&gdev->chrdev, &gpio_fileops);
        gdev->chrdev.owner = THIS_MODULE;
-       gdev->chrdev.kobj.parent = &gdev->dev.kobj;
        gdev->dev.devt = MKDEV(MAJOR(gpio_devt), gdev->id);
-       status = cdev_add(&gdev->chrdev, gdev->dev.devt, 1);
+       status = device_add_cdev(&gdev->dev, &gdev->chrdev);
        if (status < 0)
                chip_warn(gdev->chip, "failed to add char device %d:%d\n",
                          MAJOR(gpio_devt), gdev->id);
-- 
2.1.4


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
tpmdd-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tpmdd-devel

Reply via email to