Skip to contentSkip to conversation

Input: twl6040_vibra - remove unneeded check for CONFIG_OF

PATCH In review Dmitry Torokhov 2 participants 2 messages Jan 4, 2014

Subsystems (2)
lore
Share & tools
lore

Dmitry Torokhov

author maintainer
#0 lore raw

PATCH 1/1 Input: twl6040_vibra - remove unneeded check for CONFIG_OF

Since the driver requires DT now we do not need to check if CONFIG_OF is defined.

---
 drivers/input/misc/twl6040-vibra.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/input/misc/twl6040-vibra.c +1 -4
index 89bca76..77dc23b 100644
@@ -258,17 +258,14 @@ static SIMPLE_DEV_PM_OPS(twl6040_vibra_pm_ops, twl6040_vibra_suspend, NULL);
 static int twl6040_vibra_probe(struct platform_device *pdev)
 {
 	struct device *twl6040_core_dev = pdev->dev.parent;
-	struct device_node *twl6040_core_node = NULL;
+	struct device_node *twl6040_core_node;
 	struct vibra_info *info;
 	int vddvibl_uV = 0;
 	int vddvibr_uV = 0;
 	int ret;
 
-#ifdef CONFIG_OF
 	twl6040_core_node = of_find_node_by_name(twl6040_core_dev->of_node,
 						 "vibra");
-#endif
-
 	if (!twl6040_core_node) {
 		dev_err(&pdev->dev, "parent of node is missing?\n");
 		return -EINVAL;
Signature · 5 lines
1.8.4.2


-- 
Dmitry
Reviewed-by on v1 1/1
#1 lore raw

Hi

Quoted 16 lines · Dmitry Torokhov

Since the driver requires DT now we do not need to check if CONFIG_OF is defined.

---
 drivers/input/misc/twl6040-vibra.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/input/misc/twl6040-vibra.c +0 -0
index 89bca76..77dc23b 100644
@@ -258,17 +258,14 @@ static SIMPLE_DEV_PM_OPS(twl6040_vibra_pm_ops, twl6040_vibra_suspend, NULL);
 static int twl6040_vibra_probe(struct platform_device *pdev)
 {
        struct device *twl6040_core_dev = pdev->dev.parent;

drivers/input/misc/twl6040-vibra.c static SIMPLE_DEV_PM_OPS(twl6040_vibra_pm_ops, twl6040_vibra_suspend, NULL); · line 268

Quoted 10 lines
drivers/input/misc/twl6040-vibra.c +1 -2
-       struct device_node *twl6040_core_node = NULL;
+       struct device_node *twl6040_core_node;
        struct vibra_info *info;
        int vddvibl_uV = 0;
        int vddvibr_uV = 0;
        int ret;
 
-#ifdef CONFIG_OF
        twl6040_core_node = of_find_node_by_name(twl6040_core_dev->of_node,
                                                 "vibra");

If CONFIG_OF=n, of_find_node_by_name() always returns NULL. See include/linux/of.h. So no need to depend on DT.

Thanks
David

Quoted 15 lines
drivers/input/misc/twl6040-vibra.c +0 -3
-#endif
-
        if (!twl6040_core_node) {
                dev_err(&pdev->dev, "parent of node is missing?\n");
                return -EINVAL;
--

1.8.4.2

--
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html