summaryrefslogtreecommitdiff
path: root/drivers/gpio/omap_gpio.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2017-09-18 01:54:52 +0300
committerSimon Glass <sjg@chromium.org>2017-10-09 05:41:08 +0300
commit4d686041895a8fd419bbc3842856239c6298d1f2 (patch)
tree7f3d30f74760f5ee7c8f872116af4d1df7772fb1 /drivers/gpio/omap_gpio.c
parent1ba214767d85ed37c0af3ac41d2e8617a609741f (diff)
downloadu-boot-4d686041895a8fd419bbc3842856239c6298d1f2.tar.xz
dm: gpio: Add a comment about not copying some drivers
These three drivers all use U_BOOT_DEVICE rather than device tree to create devices, so have to do manual allocation of platform data. This is not true for new platforms. Add a more explicit comment so that people do not copy this approach with new boards. Signed-off-by: Simon Glass <sjg@chromium.org> Reported-by: Adam Ford <aford173@gmail.com>
Diffstat (limited to 'drivers/gpio/omap_gpio.c')
-rw-r--r--drivers/gpio/omap_gpio.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/gpio/omap_gpio.c b/drivers/gpio/omap_gpio.c
index b423e34ca4..1ab12f3f1e 100644
--- a/drivers/gpio/omap_gpio.c
+++ b/drivers/gpio/omap_gpio.c
@@ -299,7 +299,7 @@ static int omap_gpio_probe(struct udevice *dev)
static int omap_gpio_bind(struct udevice *dev)
{
- struct omap_gpio_platdata *plat = dev->platdata;
+ struct omap_gpio_platdata *plat = dev_get_platdata(dev);
fdt_addr_t base_addr;
if (plat)
@@ -314,6 +314,10 @@ static int omap_gpio_bind(struct udevice *dev)
* When every board is converted to driver model and DT is
* supported, this can be done by auto-alloc feature, but
* not using calloc to alloc memory for platdata.
+ *
+ * For example am33xx_gpio uses platform data rather than device tree.
+ *
+ * NOTE: DO NOT COPY this code if you are using device tree.
*/
plat = calloc(1, sizeof(*plat));
if (!plat)