linux/drivers/pinctrl
Fabio Baltieri 4ca075decc pinctrl: nomadik: return if prcm_base is NULL
This patch adds a check for npct->prcm_base to make sure that the
address is not NULL before using it, as the driver was made capable of
loading even without a proper memory resource in:

f1671bf pinctrl/nomadik: make independent of prcmu driver

Also, refuses to probe without prcm_base on anything else than nomadik.

This solves the following crash, introduced during the merge window when
booting on U8500 with device tree:

pinctrl-nomadik pinctrl-db8500: No PRCM base, assume no ALT-Cx control is available
Unable to handle kernel NULL pointer dereference at virtual address 00000138
pgd = c0004000
[00000138] *pgd=00000000
Internal error: Oops: 5 [#1] PREEMPT SMP ARM
Modules linked in:
CPU: 0    Not tainted  (3.7.0-02892-g1ebaf4f #631)
PC is at nmk_pmx_enable+0x1bc/0x4d0
LR is at clk_disable+0x40/0x44
[snip]
[<c01d5e50>] (nmk_pmx_enable+0x1bc/0x4d0) from [<c01d3ba8>] (pinmux_enable_setting+0x12c/0x1ec)
[<c01d3ba8>] (pinmux_enable_setting+0x12c/0x1ec) from [<c01d1dc8>] (pinctrl_select_state_locked+0xfc/0x134)
[<c01d1dc8>] (pinctrl_select_state_locked+0xfc/0x134) from [<c01d2814>] (pinctrl_register+0x26c/0x43c)
[<c01d2814>] (pinctrl_register+0x26c/0x43c) from [<c01d668c>] (nmk_pinctrl_probe+0x114/0x238)
[<c01d668c>] (nmk_pinctrl_probe+0x114/0x238) from [<c0211cc4>] (platform_drv_probe+0x28/0x2c)
[<c0211cc4>] (platform_drv_probe+0x28/0x2c) from [<c0210738>] (driver_probe_device+0x84/0x21c)
[<c0210738>] (driver_probe_device+0x84/0x21c) from [<c02109c0>] (__device_attach+0x50/0x54)
[<c02109c0>] (__device_attach+0x50/0x54) from [<c020eb1c>] (bus_for_each_drv+0x54/0x9c)
[<c020eb1c>] (bus_for_each_drv+0x54/0x9c) from [<c0210668>] (device_attach+0x84/0x9c)
[<c0210668>] (device_attach+0x84/0x9c) from [<c020fbac>] (bus_probe_device+0x94/0xb8)
[<c020fbac>] (bus_probe_device+0x94/0xb8) from [<c020e084>] (device_add+0x4f0/0x5bc)
[<c020e084>] (device_add+0x4f0/0x5bc) from [<c0276400>] (of_device_add+0x40/0x48)
[<c0276400>] (of_device_add+0x40/0x48) from [<c0276a98>] (of_platform_device_create_pdata+0x68/0x98)
[<c0276a98>] (of_platform_device_create_pdata+0x68/0x98) from [<c0276bac>] (of_platform_bus_create+0xe4/0x260)
[<c0276bac>] (of_platform_bus_create+0xe4/0x260) from [<c0276bf8>] (of_platform_bus_create+0x130/0x260)
[<c0276bf8>] (of_platform_bus_create+0x130/0x260) from [<c0276d94>] (of_platform_populate+0x6c/0xac)
[<c0276d94>] (of_platform_populate+0x6c/0xac) from [<c04a8224>] (u8500_init_machine+0x78/0x140)
[<c04a8224>] (u8500_init_machine+0x78/0x140) from [<c04a3560>] (customize_machine+0x24/0x30)
[<c04a3560>] (customize_machine+0x24/0x30) from [<c00087b0>] (do_one_initcall+0x130/0x1b0)
[<c00087b0>] (do_one_initcall+0x130/0x1b0) from [<c033ff9c>] (kernel_init+0x138/0x2e8)
[<c033ff9c>] (kernel_init+0x138/0x2e8) from [<c000eb18>] (ret_from_fork+0x14/0x20)
Code: 0a00001b e19400b2 e59a200c e0822000 (e592c000)
---[ end trace 1b75b31a2719ed1c ]---
note: swapper/0[1] exited with preempt_count 1
Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b

Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2012-12-26 01:59:54 +01:00
..
mvebu ARM: Kirkwood: support 98DX412x kirkwoods with pinctrl 2012-11-24 02:58:43 +00:00
spear Driver core updates for 3.8-rc1 2012-12-11 13:13:55 -08:00
Kconfig ARM: arm-soc: SoC updates for 3.8 2012-12-12 12:05:15 -08:00
Makefile ARM: arm-soc: SoC updates for 3.8 2012-12-12 12:05:15 -08:00
core.c pinctrl: fix comment mistake 2012-12-26 01:59:52 +01:00
core.h pinctrl: reserve pins when states are activated 2012-11-11 19:05:56 +01:00
devicetree.c gpiolib: separation of pin concerns 2012-11-11 19:06:07 +01:00
devicetree.h pinctrl: core device tree mapping table parsing support 2012-04-18 13:53:10 +02:00
pinconf-generic.c pinctrl: generic: add input schmitt disable parameter 2012-11-21 08:55:26 +01:00
pinconf.c pinctrl: remove mutex lock in groups show 2012-10-18 20:27:31 +02:00
pinconf.h pinctrl: pinconf: fix compilation error if PINCONF is not selected 2012-04-18 13:53:12 +02:00
pinctrl-at91.c drivers/pinctrl/pinctrl-at91.c: convert kfree to devm_kfree 2012-12-26 01:59:51 +01:00
pinctrl-bcm2835.c Driver core updates for 3.8-rc1 2012-12-11 13:13:55 -08:00
pinctrl-coh901.c pinctrl/u300/coh901: stop spawning pinctrl from GPIO 2012-11-21 08:55:22 +01:00
pinctrl-coh901.h pinctrl: support pinconfig on the U300 2012-03-12 22:49:03 +01:00
pinctrl-exynos.c ARM: arm-soc: SoC updates for 3.8 2012-12-12 12:05:15 -08:00
pinctrl-exynos.h pinctrl: samsung: Use per-bank IRQ domain for wake-up interrupts 2012-10-15 09:10:12 +02:00
pinctrl-exynos5440.c pinctrl: exynos5440/samsung: Staticize pcfgs 2012-12-18 19:00:25 -08:00
pinctrl-falcon.c pinctrl: Staticize pinconf_ops 2012-11-11 19:35:38 +01:00
pinctrl-imx.c Driver core updates for 3.8-rc1 2012-12-11 13:13:55 -08:00
pinctrl-imx.h pinctrl: pinctrl-imx: add imx pinctrl core driver 2012-05-02 01:14:40 +02:00
pinctrl-imx6q.c pinctrl: remove use of __devinitdata 2012-11-28 11:55:55 -08:00
pinctrl-imx23.c pinctrl: remove use of __devinitdata 2012-11-28 11:55:55 -08:00
pinctrl-imx28.c pinctrl: remove use of __devinitdata 2012-11-28 11:55:55 -08:00
pinctrl-imx35.c pinctrl: remove use of __devinitdata 2012-11-28 11:55:55 -08:00
pinctrl-imx51.c pinctrl: remove use of __devinitdata 2012-11-28 11:55:55 -08:00
pinctrl-imx53.c pinctrl: imx5: fix GPIO_8 pad CAN1_RXCAN configuration 2012-12-26 01:59:50 +01:00
pinctrl-lantiq.c pinctrl: lantiq: Staticize non-exported symbols 2012-11-11 19:36:13 +01:00
pinctrl-lantiq.h OF: pinctrl: MIPS: lantiq: implement lantiq/xway pinctrl support 2012-09-13 10:30:49 +02:00
pinctrl-mmp2.c pinctrl: remove use of __devexit 2012-11-28 11:58:23 -08:00
pinctrl-mxs.c Driver core updates for 3.8-rc1 2012-12-11 13:13:55 -08:00
pinctrl-mxs.h pinctrl: add pinctrl-mxs support 2012-05-02 01:18:27 +02:00
pinctrl-nomadik-db8500.c pinctrl/nomadik: db8500: split clkout group 2012-11-15 11:21:46 +01:00
pinctrl-nomadik-db8540.c pinctrl/nomadik: db8540: split clkout group 2012-11-15 11:21:47 +01:00
pinctrl-nomadik-stn8815.c pinctrl/nomadik: add STn8815 ASIC support 2012-09-03 13:21:37 +02:00
pinctrl-nomadik.c pinctrl: nomadik: return if prcm_base is NULL 2012-12-26 01:59:54 +01:00
pinctrl-nomadik.h pinctrl/nomadik: move the platform data header 2012-11-05 09:55:27 +01:00
pinctrl-pxa3xx.c pinctrl: pxa3xx: Remove phy_base and phy_size from struct pxa3xx_pinmux_info 2012-11-15 11:21:46 +01:00
pinctrl-pxa3xx.h pinctrl: pxa3xx: Remove phy_base and phy_size from struct pxa3xx_pinmux_info 2012-11-15 11:21:46 +01:00
pinctrl-pxa168.c pinctrl: remove use of __devexit 2012-11-28 11:58:23 -08:00
pinctrl-pxa910.c pinctrl: remove use of __devexit 2012-11-28 11:58:23 -08:00
pinctrl-samsung.c pinctrl: exynos5440/samsung: Staticize pcfgs 2012-12-18 19:00:25 -08:00
pinctrl-samsung.h pinctrl: samsung: Fix a typo in pinctrl-samsung.h 2012-12-18 19:00:25 -08:00
pinctrl-single.c Driver core updates for 3.8-rc1 2012-12-11 13:13:55 -08:00
pinctrl-sirf.c pinctrl: sirf: enable GPIO pullup/down configuration from dts 2012-12-26 01:59:53 +01:00
pinctrl-tegra.c Driver core updates for 3.8-rc1 2012-12-11 13:13:55 -08:00
pinctrl-tegra.h pinctrl: tegra: move pinconf-tegra.h content into drivers/pinctrl 2012-09-14 11:35:37 -06:00
pinctrl-tegra20.c pinctrl: remove use of __devinitdata 2012-11-28 11:55:55 -08:00
pinctrl-tegra30.c pinctrl: remove use of __devinitdata 2012-11-28 11:55:55 -08:00
pinctrl-u300.c Driver core updates for 3.8-rc1 2012-12-11 13:13:55 -08:00
pinctrl-xway.c pinctrl: Staticize pinconf_ops 2012-11-11 19:35:38 +01:00
pinmux.c pinctrl: pinmux: Release all taken pins in pinmux_enable_setting error paths 2012-11-11 20:18:32 +01:00
pinmux.h pinctrl: ifdef CONFIG_DEBUG_FS cleanup 2012-04-18 13:53:12 +02:00