]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
gpio: mpc8xxx: use generic device_is_compatible()
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Wed, 9 Oct 2024 16:29:10 +0000 (18:29 +0200)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Mon, 14 Oct 2024 08:30:11 +0000 (10:30 +0200)
This driver doesn't need to include of.h and use OF-specific interfaces.
Use generic property helpers instead.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20241009162910.33477-2-brgl@bgdev.pl
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
drivers/gpio/gpio-mpc8xxx.c

index 30f36f94ba1b89f7dbafceffcfa06598152db283..2f66e24127f4b2e3b3902cbc514a483b85c8c7b5 100644 (file)
@@ -15,7 +15,6 @@
 #include <linux/irq.h>
 #include <linux/kernel.h>
 #include <linux/mod_devicetable.h>
-#include <linux/of.h>
 #include <linux/platform_device.h>
 #include <linux/pm.h>
 #include <linux/pm_runtime.h>
@@ -301,7 +300,6 @@ static const struct of_device_id mpc8xxx_gpio_ids[] = {
 static int mpc8xxx_probe(struct platform_device *pdev)
 {
        const struct mpc8xxx_gpio_devtype *devtype = NULL;
-       struct device_node *np = pdev->dev.of_node;
        struct mpc8xxx_gpio_chip *mpc8xxx_gc;
        struct device *dev = &pdev->dev;
        struct fwnode_handle *fwnode;
@@ -368,9 +366,9 @@ static int mpc8xxx_probe(struct platform_device *pdev)
         * the port value to the GPIO Data Register.
         */
        fwnode = dev_fwnode(dev);
-       if (of_device_is_compatible(np, "fsl,qoriq-gpio") ||
-           of_device_is_compatible(np, "fsl,ls1028a-gpio") ||
-           of_device_is_compatible(np, "fsl,ls1088a-gpio") ||
+       if (device_is_compatible(dev, "fsl,qoriq-gpio") ||
+           device_is_compatible(dev, "fsl,ls1028a-gpio") ||
+           device_is_compatible(dev, "fsl,ls1088a-gpio") ||
            is_acpi_node(fwnode)) {
                gc->write_reg(mpc8xxx_gc->regs + GPIO_IBE, 0xffffffff);
                /* Also, latch state of GPIOs configured as output by bootloader. */