Message ID | 1352955096.6793.1.camel@phoenix (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Dear Axel Lin, On Thu, 15 Nov 2012 12:51:36 +0800, Axel Lin wrote: > of_match_device() may return NULL. > > Signed-off-by: Axel Lin <axel.lin@ingics.com> Could you detail under what conditions of_match_device() may return NULL in the specific case of this driver? This of_match_device() call is using the same dove_pinctrl_of_match array that is used to ->probe() this driver. So I don't see how you can get into ->probe() without having a matching entry. Am I missing something? Best regards, Thomas
Dear Axel Lin, On Thu, 15 Nov 2012 21:44:07 +0800, Axel Lin wrote: > BTW, I found there is no way to compile the dove and kirkwood pinctrl > drivers. > I need add below patch to compile these two drivers, how do you think about > below patch? > ( In dove, the USE_OF is optional, it is selected only when MACH_DOVE_DT is > enabled ) > > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig > index 14f8160..dda6785 100644 > --- a/arch/arm/Kconfig > +++ b/arch/arm/Kconfig > @@ -531,6 +531,8 @@ config ARCH_DOVE > select CPU_V7 > select GENERIC_CLOCKEVENTS > select MIGHT_HAVE_PCI > + select PINCTRL > + select PINCTRL_DOVE if USE_OF > select PLAT_ORION_LEGACY > select USB_ARCH_HAS_EHCI > help > @@ -542,6 +544,8 @@ config ARCH_KIRKWOOD > select CPU_FEROCEON > select GENERIC_CLOCKEVENTS > select PCI > + select PINCTRL > + select PINCTRL_KIRKWOOD > select PLAT_ORION_LEGACY > help > Support for the following Marvell Kirkwood series SoCs: See "[PATCH 1/5] ARM: Kirkwood: Allow use of pinctrl" and "[PATCH 4/5] ARM: Dove: Make use of pinctrl driver" which have been posted by Andrew Lunn on October, 24th. Best regards, Thomas
diff --git a/drivers/pinctrl/mvebu/pinctrl-dove.c b/drivers/pinctrl/mvebu/pinctrl-dove.c index ffe74b2..a8b9b42 100644 --- a/drivers/pinctrl/mvebu/pinctrl-dove.c +++ b/drivers/pinctrl/mvebu/pinctrl-dove.c @@ -578,8 +578,12 @@ static struct of_device_id dove_pinctrl_of_match[] __devinitdata = { static int __devinit dove_pinctrl_probe(struct platform_device *pdev) { - const struct of_device_id *match = - of_match_device(dove_pinctrl_of_match, &pdev->dev); + const struct of_device_id *match; + + match = of_match_device(dove_pinctrl_of_match, &pdev->dev); + if (!match) + return -ENODEV; + pdev->dev.platform_data = match->data; /*
of_match_device() may return NULL. Signed-off-by: Axel Lin <axel.lin@ingics.com> --- drivers/pinctrl/mvebu/pinctrl-dove.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)