diff options
author | Christophe Leroy <christophe.leroy@c-s.fr> | 2017-12-13 12:26:23 +0100 |
---|---|---|
committer | Scott Wood <oss@buserror.net> | 2018-01-20 23:29:02 -0600 |
commit | c095ff93f901c1620b28dce4d813dd548bc5236b (patch) | |
tree | 55eae5b85d07619c35e7f7053568559d9f1a1545 /arch/powerpc/sysdev/cpm_common.c | |
parent | d038386a0cecaf5283745f951bc35c49bd78da22 (diff) | |
download | linux-c095ff93f901c1620b28dce4d813dd548bc5236b.tar.gz linux-c095ff93f901c1620b28dce4d813dd548bc5236b.tar.bz2 linux-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 'arch/powerpc/sysdev/cpm_common.c')
-rw-r--r-- | arch/powerpc/sysdev/cpm_common.c | 5 |
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); } |