aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/sysdev/cpm_common.c
diff options
context:
space:
mode:
authorChristophe Leroy <christophe.leroy@c-s.fr>2017-12-13 12:26:23 +0100
committerScott Wood <oss@buserror.net>2018-01-20 23:29:02 -0600
commitc095ff93f901c1620b28dce4d813dd548bc5236b (patch)
tree55eae5b85d07619c35e7f7053568559d9f1a1545 /arch/powerpc/sysdev/cpm_common.c
parentpowerpc/fsl_pci: Fix ptr_ret.cocci warnings (diff)
downloadlinux-dev-c095ff93f901c1620b28dce4d813dd548bc5236b.tar.xz
linux-dev-c095ff93f901c1620b28dce4d813dd548bc5236b.zip
powerpc/sysdev: change CPM GPIO to platform_device
Since commit 9427ecbed46cc ("gpio: Rework of_gpiochip_set_names() to use device property accessors"), gpio chips have to have a parent, otherwise devprop_gpiochip_set_names() prematurely exists with message "GPIO chip parent is NULL" and doesn't proceed 'gpio-line-names' DT property. This patch wraps the CPM GPIO into a platform driver to allow assignment of the parent device. Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr> Signed-off-by: Scott Wood <oss@buserror.net>
Diffstat (limited to '')
-rw-r--r--arch/powerpc/sysdev/cpm_common.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/powerpc/sysdev/cpm_common.c b/arch/powerpc/sysdev/cpm_common.c
index 51bf749a4f3a..b74508175b67 100644
--- a/arch/powerpc/sysdev/cpm_common.c
+++ b/arch/powerpc/sysdev/cpm_common.c
@@ -190,8 +190,9 @@ static int cpm2_gpio32_dir_in(struct gpio_chip *gc, unsigned int gpio)
return 0;
}
-int cpm2_gpiochip_add32(struct device_node *np)
+int cpm2_gpiochip_add32(struct device *dev)
{
+ struct device_node *np = dev->of_node;
struct cpm2_gpio32_chip *cpm2_gc;
struct of_mm_gpio_chip *mm_gc;
struct gpio_chip *gc;
@@ -211,6 +212,8 @@ int cpm2_gpiochip_add32(struct device_node *np)
gc->direction_output = cpm2_gpio32_dir_out;
gc->get = cpm2_gpio32_get;
gc->set = cpm2_gpio32_set;
+ gc->parent = dev;
+ gc->owner = THIS_MODULE;
return of_mm_gpiochip_add_data(np, mm_gc, cpm2_gc);
}