Re: [PATCH v3 2/2] wl18xx: add basic device-tree support

From
Arnd Bergmann <arnd@arndb.de>
Date
2015-02-27 08:26:13
Also in
linux-devicetree
On Thursday 19 February 2015 18:13:21 Eliad Peller wrote:
quoted hunk
+
+static struct wl12xx_platform_data *wlcore_probe_of(struct device *dev)
+{
+       struct device_node *np = dev->of_node;
+       struct wl12xx_platform_data *pdata;
+
+       if (!np || !of_match_node(wlcore_sdio_of_match_table, np)) {
+               dev_err(dev, "No platform data set\n");
+               return NULL;
+       }
+
+       pdata = kzalloc(sizeof(*pdata), GFP_KERNEL);
+       if (!pdata)
+               return NULL;
+
+       pdata->irq = irq_of_parse_and_map(np, 0);
+       if (!pdata->irq) {
+               dev_err(dev, "No irq in platform data\n");
+               kfree(pdata);
+               return NULL;
+       }
+
+       return pdata;
+}
+#else
+static struct wl12xx_platform_data *wlcore_probe_of(struct device *dev)
+{
+       return NULL;
+}
+#endif
+
+static struct wl12xx_platform_data *
+wlcore_get_platform_data(struct device *dev)
+{
+       struct wl12xx_platform_data *pdata;
+
+       pdata = wl12xx_get_platform_data();
+       if (!IS_ERR(pdata))
+               return kmemdup(pdata, sizeof(*pdata), GFP_KERNEL);
+
+       return wlcore_probe_of(dev);
+}
I think the probe_of needs to come first here, otherwise you cannot
override the pdata quirk with actual DT data.

I've looked up the what boards actually use this data and found that
all of them already support booting from DT: some omap2 boards using
arch/arm/mach-omap2/pdata-quirks.c to provide the data, and the
davinci 850evm. Can you make sure you add the correct data to all
of these dts files as part of your series and remove the
wl12xx_platform_data references?

	Arnd
Thread (2 messages) 2 messages, 2 authors, last reply 2015-03-08
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help