summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpio/gpio-clps711x.c39
-rw-r--r--drivers/gpio/gpiolib.c26
-rw-r--r--drivers/mci/imx-esdhc.c2
-rw-r--r--drivers/mci/imx.c9
-rw-r--r--drivers/mfd/syscon.c23
-rw-r--r--drivers/net/phy/phy.c5
-rw-r--r--drivers/pinctrl/Kconfig1
-rw-r--r--drivers/pinctrl/imx-iomux-v1.c198
-rw-r--r--drivers/serial/serial_clps711x.c120
-rw-r--r--drivers/usb/gadget/at91_udc.c3
10 files changed, 363 insertions, 63 deletions
diff --git a/drivers/gpio/gpio-clps711x.c b/drivers/gpio/gpio-clps711x.c
index feead51527..2f12439e0f 100644
--- a/drivers/gpio/gpio-clps711x.c
+++ b/drivers/gpio/gpio-clps711x.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013 Alexander Shiyan <shc_work@mail.ru>
+ * Copyright (C) 2013-2014 Alexander Shiyan <shc_work@mail.ru>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -15,15 +15,18 @@
static int clps711x_gpio_probe(struct device_d *dev)
{
- int err;
+ int err, id = dev->id;
void __iomem *dat, *dir = NULL, *dir_inv = NULL;
struct bgpio_chip *bgc;
- if ((dev->id < 0) || (dev->id > 4))
+ if (dev->device_node)
+ id = of_alias_get_id(dev->device_node, "gpio");
+
+ if (id < 0 || id > 4)
return -ENODEV;
dat = dev_request_mem_region(dev, 0);
- switch (dev->id) {
+ switch (id) {
case 3:
dir_inv = dev_request_mem_region(dev, 1);
break;
@@ -40,27 +43,35 @@ static int clps711x_gpio_probe(struct device_d *dev)
return -ENOMEM;
err = bgpio_init(bgc, dev, 1, dat, NULL, NULL, dir, dir_inv, 0);
- if (err) {
- free(bgc);
- return err;
- }
+ if (err)
+ goto out_err;
- bgc->gc.base = dev->id * 8;
- switch (dev->id) {
+ bgc->gc.base = id * 8;
+ switch (id) {
case 4:
bgc->gc.ngpio = 3;
break;
default:
- bgc->gc.ngpio = 8;
break;
}
- return gpiochip_add(&bgc->gc);
+ err = gpiochip_add(&bgc->gc);
+
+out_err:
+ if (err)
+ free(bgc);
+
+ return err;
}
+static struct of_device_id __maybe_unused clps711x_gpio_dt_ids[] = {
+ { .compatible = "cirrus,clps711x-gpio", },
+};
+
static struct driver_d clps711x_gpio_driver = {
- .name = "clps711x-gpio",
- .probe = clps711x_gpio_probe,
+ .name = "clps711x-gpio",
+ .probe = clps711x_gpio_probe,
+ .of_compatible = DRV_OF_COMPAT(clps711x_gpio_dt_ids),
};
static __init int clps711x_gpio_register(void)
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index cafef907ef..193c36ca29 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -50,22 +50,33 @@ int gpio_request(unsigned gpio, const char *label)
struct gpio_info *gi = gpio_to_desc(gpio);
int ret;
- if (!gi)
- return -ENODEV;
+ if (!gi) {
+ ret = -ENODEV;
+ goto done;
+ }
- if (gi->requested)
- return -EBUSY;
+ if (gi->requested) {
+ ret = -EBUSY;
+ goto done;
+ }
+
+ ret = 0;
if (gi->chip->ops->request) {
ret = gi->chip->ops->request(gi->chip, gpio - gi->chip->base);
if (ret)
- return ret;
+ goto done;
}
gi->requested = true;
gi->label = xstrdup(label);
- return 0;
+done:
+ if (ret)
+ pr_err("_gpio_request: gpio-%d (%s) status %d\n",
+ gpio, label ? : "?", ret);
+
+ return ret;
}
void gpio_free(unsigned gpio)
@@ -83,6 +94,7 @@ void gpio_free(unsigned gpio)
gi->requested = false;
free(gi->label);
+ gi->label = NULL;
}
/**
@@ -322,7 +334,7 @@ static int do_gpiolib(int argc, char *argv[])
3, (dir < 0) ? "unk" : ((dir == GPIOF_DIR_IN) ? "in" : "out"),
3, (val < 0) ? "unk" : ((val == 0) ? "lo" : "hi"),
9, gi->requested ? "true" : "false",
- gi->label ? gi->label : "");
+ (gi->requested && gi->label) ? gi->label : "");
}
return 0;
diff --git a/drivers/mci/imx-esdhc.c b/drivers/mci/imx-esdhc.c
index 4c7a45e722..f5e78e0d79 100644
--- a/drivers/mci/imx-esdhc.c
+++ b/drivers/mci/imx-esdhc.c
@@ -596,6 +596,8 @@ static int fsl_esdhc_probe(struct device_d *dev)
static __maybe_unused struct of_device_id fsl_esdhc_compatible[] = {
{
+ .compatible = "fsl,imx25-esdhc",
+ }, {
.compatible = "fsl,imx51-esdhc",
}, {
.compatible = "fsl,imx53-esdhc",
diff --git a/drivers/mci/imx.c b/drivers/mci/imx.c
index aea78c7550..6992177af6 100644
--- a/drivers/mci/imx.c
+++ b/drivers/mci/imx.c
@@ -520,8 +520,17 @@ static int mxcmci_probe(struct device_d *dev)
return 0;
}
+static __maybe_unused struct of_device_id mxcmci_compatible[] = {
+ {
+ .compatible = "fsl,imx27-mmc",
+ }, {
+ /* sentinel */
+ }
+};
+
static struct driver_d mxcmci_driver = {
.name = DRIVER_NAME,
.probe = mxcmci_probe,
+ .of_compatible = DRV_OF_COMPAT(mxcmci_compatible),
};
device_platform_driver(mxcmci_driver);
diff --git a/drivers/mfd/syscon.c b/drivers/mfd/syscon.c
index 52cb433a39..8fc84c34d8 100644
--- a/drivers/mfd/syscon.c
+++ b/drivers/mfd/syscon.c
@@ -41,6 +41,26 @@ void __iomem *syscon_base_lookup_by_pdevname(const char *s)
return ERR_PTR(-ENODEV);
}
+void __iomem *syscon_base_lookup_by_phandle(struct device_node *np,
+ const char *property)
+{
+ struct device_node *node;
+ struct syscon *syscon;
+ struct device_d *dev;
+
+ node = of_parse_phandle(np, property, 0);
+ if (!node)
+ return ERR_PTR(-ENODEV);
+
+ dev = of_find_device_by_node(node);
+ if (!dev)
+ return ERR_PTR(-ENODEV);
+
+ syscon = dev->priv;
+
+ return syscon->base;
+}
+
static int syscon_probe(struct device_d *dev)
{
struct syscon *syscon;
@@ -72,9 +92,6 @@ static int syscon_probe(struct device_d *dev)
static struct platform_device_id syscon_ids[] = {
{ "syscon", },
-#ifdef CONFIG_ARCH_CLPS711X
- { "clps711x-syscon", },
-#endif
{ }
};
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 6ca1bb2573..faa5c26c22 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -290,6 +290,11 @@ int phy_device_connect(struct eth_device *edev, struct mii_bus *bus, int addr,
if (!IS_ERR(dev) && !dev->attached_dev)
break;
}
+
+ if (IS_ERR(dev)) {
+ ret = PTR_ERR(dev);
+ goto fail;
+ }
}
if (dev->attached_dev)
diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig
index c6bb51c3b8..7390971ea3 100644
--- a/drivers/pinctrl/Kconfig
+++ b/drivers/pinctrl/Kconfig
@@ -8,6 +8,7 @@ config PINCTRL
support but instead provide their own SoC specific APIs
config PINCTRL_IMX_IOMUX_V1
+ select PINCTRL if OFDEVICE
bool
help
This iomux controller is found on i.MX1,21,27.
diff --git a/drivers/pinctrl/imx-iomux-v1.c b/drivers/pinctrl/imx-iomux-v1.c
index f8f90615c6..16415c2de0 100644
--- a/drivers/pinctrl/imx-iomux-v1.c
+++ b/drivers/pinctrl/imx-iomux-v1.c
@@ -1,5 +1,8 @@
#include <common.h>
#include <io.h>
+#include <init.h>
+#include <malloc.h>
+#include <pinctrl.h>
#include <mach/iomux-v1.h>
/*
@@ -29,6 +32,11 @@
static void __iomem *iomuxv1_base;
+struct imx_iomux_v1 {
+ void __iomem *base;
+ struct pinctrl_device pinctrl;
+};
+
void imx_gpio_mode(int gpio_mode)
{
unsigned int pin = gpio_mode & GPIO_PIN_MASK;
@@ -114,3 +122,193 @@ void imx_iomuxv1_init(void __iomem *base)
{
iomuxv1_base = base;
}
+
+/*
+ * MUX_ID format defines
+ */
+#define MX1_MUX_FUNCTION(val) (BIT(0) & val)
+#define MX1_MUX_GPIO(val) ((BIT(1) & val) >> 1)
+#define MX1_MUX_DIR(val) ((BIT(2) & val) >> 2)
+#define MX1_MUX_OCONF(val) (((BIT(4) | BIT(5)) & val) >> 4)
+#define MX1_MUX_ICONFA(val) (((BIT(8) | BIT(9)) & val) >> 8)
+#define MX1_MUX_ICONFB(val) (((BIT(10) | BIT(11)) & val) >> 10)
+
+#define MX1_PORT_STRIDE 0x100
+
+/*
+ * IMX1 IOMUXC manages the pins based on ports. Each port has 32 pins. IOMUX
+ * control register are seperated into function, output configuration, input
+ * configuration A, input configuration B, GPIO in use and data direction.
+ *
+ * Those controls that are represented by 1 bit have a direct mapping between
+ * bit position and pin id. If they are represented by 2 bit, the lower 16 pins
+ * are in the first register and the upper 16 pins in the second (next)
+ * register. pin_id is stored in bit (pin_id%16)*2 and the bit above.
+ */
+
+/*
+ * Calculates the register offset from a pin_id
+ */
+static void __iomem *imx1_mem(struct imx_iomux_v1 *iomux, unsigned int pin_id)
+{
+ unsigned int port = pin_id / 32;
+ return iomux->base + port * MX1_PORT_STRIDE;
+}
+
+/*
+ * Write to a register with 2 bits per pin. The function will automatically
+ * use the next register if the pin is managed in the second register.
+ */
+static void imx1_write_2bit(struct imx_iomux_v1 *iomux, unsigned int pin_id,
+ u32 value, u32 reg_offset)
+{
+ void __iomem *reg = imx1_mem(iomux, pin_id) + reg_offset;
+ int offset = (pin_id % 16) * 2; /* offset, regardless of register used */
+ int mask = ~(0x3 << offset); /* Mask for 2 bits at offset */
+ u32 old_val;
+ u32 new_val;
+
+ dev_dbg(iomux->pinctrl.dev, "write: register 0x%p offset %d value 0x%x\n",
+ reg, offset, value);
+
+ /* Use the next register if the pin's port pin number is >=16 */
+ if (pin_id % 32 >= 16)
+ reg += 0x04;
+
+ /* Get current state of pins */
+ old_val = readl(reg);
+ old_val &= mask;
+
+ new_val = value & 0x3; /* Make sure value is really 2 bit */
+ new_val <<= offset;
+ new_val |= old_val;/* Set new state for pin_id */
+
+ writel(new_val, reg);
+}
+
+static void imx1_write_bit(struct imx_iomux_v1 *iomux, unsigned int pin_id,
+ u32 value, u32 reg_offset)
+{
+ void __iomem *reg = imx1_mem(iomux, pin_id) + reg_offset;
+ int offset = pin_id % 32;
+ int mask = ~BIT_MASK(offset);
+ u32 old_val;
+ u32 new_val;
+
+ /* Get current state of pins */
+ old_val = readl(reg);
+ old_val &= mask;
+
+ new_val = value & 0x1; /* Make sure value is really 1 bit */
+ new_val <<= offset;
+ new_val |= old_val;/* Set new state for pin_id */
+
+ writel(new_val, reg);
+}
+
+static int imx_iomux_v1_set_state(struct pinctrl_device *pdev, struct device_node *np)
+{
+ struct imx_iomux_v1 *iomux = container_of(pdev, struct imx_iomux_v1, pinctrl);
+ const __be32 *list;
+ int npins, size, i;
+
+ dev_dbg(iomux->pinctrl.dev, "set state: %s\n", np->full_name);
+
+ list = of_get_property(np, "fsl,pins", &size);
+ if (!list)
+ return -EINVAL;
+
+ npins = size / 12;
+
+ for (i = 0; i < npins; i++) {
+ unsigned int pin_id = be32_to_cpu(*list++);
+ unsigned int mux = be32_to_cpu(*list++);
+ unsigned int config = be32_to_cpu(*list++);
+ unsigned int afunction = MX1_MUX_FUNCTION(mux);
+ unsigned int gpio_in_use = MX1_MUX_GPIO(mux);
+ unsigned int direction = MX1_MUX_DIR(mux);
+ unsigned int gpio_oconf = MX1_MUX_OCONF(mux);
+ unsigned int gpio_iconfa = MX1_MUX_ICONFA(mux);
+ unsigned int gpio_iconfb = MX1_MUX_ICONFB(mux);
+
+ dev_dbg(pdev->dev, "%s, pin 0x%x, function %d, gpio %d, direction %d, oconf %d, iconfa %d, iconfb %d\n",
+ np->full_name, pin_id, afunction, gpio_in_use,
+ direction, gpio_oconf, gpio_iconfa,
+ gpio_iconfb);
+
+ imx1_write_bit(iomux, pin_id, gpio_in_use, GIUS);
+ imx1_write_bit(iomux, pin_id, direction, DDIR);
+
+ if (gpio_in_use) {
+ imx1_write_2bit(iomux, pin_id, gpio_oconf, OCR1);
+ imx1_write_2bit(iomux, pin_id, gpio_iconfa, ICONFA1);
+ imx1_write_2bit(iomux, pin_id, gpio_iconfb, ICONFB1);
+ } else {
+ imx1_write_bit(iomux, pin_id, afunction, GPR);
+ }
+
+ imx1_write_bit(iomux, pin_id, config & 0x01, PUEN);
+ }
+
+ return 0;
+}
+
+static struct pinctrl_ops imx_iomux_v1_ops = {
+ .set_state = imx_iomux_v1_set_state,
+};
+
+static int imx_pinctrl_dt(struct device_d *dev, void __iomem *base)
+{
+ struct imx_iomux_v1 *iomux;
+ int ret;
+
+ iomux = xzalloc(sizeof(*iomux));
+
+ iomux->base = base;
+
+ iomux->pinctrl.dev = dev;
+ iomux->pinctrl.ops = &imx_iomux_v1_ops;
+
+ ret = pinctrl_register(&iomux->pinctrl);
+ if (ret)
+ free(iomux);
+
+ return ret;
+}
+
+static int imx_iomux_v1_probe(struct device_d *dev)
+{
+ int ret = 0;
+
+ if (iomuxv1_base)
+ return -EBUSY;
+
+ iomuxv1_base = dev_get_mem_region(dev, 0);
+
+ ret = of_platform_populate(dev->device_node, NULL, NULL);
+
+ if (IS_ENABLED(CONFIG_PINCTRL) && dev->device_node)
+ ret = imx_pinctrl_dt(dev, iomuxv1_base);
+
+ return ret;
+}
+
+static __maybe_unused struct of_device_id imx_iomux_v1_dt_ids[] = {
+ {
+ .compatible = "fsl,imx27-iomuxc",
+ }, {
+ /* sentinel */
+ }
+};
+
+static struct driver_d imx_iomux_v1_driver = {
+ .name = "imx-iomuxv1",
+ .probe = imx_iomux_v1_probe,
+ .of_compatible = DRV_OF_COMPAT(imx_iomux_v1_dt_ids),
+};
+
+static int imx_iomux_v1_init(void)
+{
+ return platform_driver_register(&imx_iomux_v1_driver);
+}
+postcore_initcall(imx_iomux_v1_init);
diff --git a/drivers/serial/serial_clps711x.c b/drivers/serial/serial_clps711x.c
index e43d141703..a75547ce80 100644
--- a/drivers/serial/serial_clps711x.c
+++ b/drivers/serial/serial_clps711x.c
@@ -1,7 +1,7 @@
/*
* Simple CLPS711X serial driver
*
- * (C) Copyright 2012 Alexander Shiyan <shc_work@mail.ru>
+ * (C) Copyright 2012-2014 Alexander Shiyan <shc_work@mail.ru>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -17,19 +17,37 @@
#include <linux/err.h>
#include <mfd/syscon.h>
-#include <mach/clps711x.h>
+#define UARTDR 0x00
+# define UARTDR_FRMERR (1 << 8)
+# define UARTDR_PARERR (1 << 9)
+# define UARTDR_OVERR (1 << 10)
+#define UBRLCR 0x40
+# define UBRLCR_BAUD_MASK ((1 << 12) - 1)
+# define UBRLCR_BREAK (1 << 12)
+# define UBRLCR_PRTEN (1 << 13)
+# define UBRLCR_EVENPRT (1 << 14)
+# define UBRLCR_XSTOP (1 << 15)
+# define UBRLCR_FIFOEN (1 << 16)
+# define UBRLCR_WRDLEN5 (0 << 17)
+# define UBRLCR_WRDLEN6 (1 << 17)
+# define UBRLCR_WRDLEN7 (2 << 17)
+# define UBRLCR_WRDLEN8 (3 << 17)
+# define UBRLCR_WRDLEN_MASK (3 << 17)
+
+#define SYSCON 0x00
+# define SYSCON_UARTEN (1 << 8)
+#define SYSFLG 0x40
+# define SYSFLG_UBUSY (1 << 11)
+# define SYSFLG_URXFE (1 << 22)
+# define SYSFLG_UTXFF (1 << 23)
struct clps711x_uart {
- void __iomem *UBRLCR;
- void __iomem *UARTDR;
+ void __iomem *base;
void __iomem *syscon;
struct clk *uart_clk;
struct console_device cdev;
};
-#define SYSCON(x) ((x)->syscon + 0x00)
-#define SYSFLG(x) ((x)->syscon + 0x40)
-
static int clps711x_setbaudrate(struct console_device *cdev, int baudrate)
{
struct clps711x_uart *s = cdev->dev->priv;
@@ -38,9 +56,9 @@ static int clps711x_setbaudrate(struct console_device *cdev, int baudrate)
divisor = (clk_get_rate(s->uart_clk) / 16) / baudrate;
- tmp = readl(s->UBRLCR) & ~UBRLCR_BAUD_MASK;
+ tmp = readl(s->base + UBRLCR) & ~UBRLCR_BAUD_MASK;
tmp |= divisor - 1;
- writel(tmp, s->UBRLCR);
+ writel(tmp, s->base + UBRLCR);
return 0;
}
@@ -51,15 +69,17 @@ static void clps711x_init_port(struct console_device *cdev)
u32 tmp;
/* Disable the UART */
- writel(readl(SYSCON(s)) & ~SYSCON_UARTEN, SYSCON(s));
+ tmp = readl(s->syscon + SYSCON);
+ writel(tmp & ~SYSCON_UARTEN, s->syscon + SYSCON);
/* Setup Line Control Register */
- tmp = readl(s->UBRLCR) & UBRLCR_BAUD_MASK;
+ tmp = readl(s->base + UBRLCR) & UBRLCR_BAUD_MASK;
tmp |= UBRLCR_FIFOEN | UBRLCR_WRDLEN8; /* FIFO on, 8N1 mode */
- writel(tmp, s->UBRLCR);
+ writel(tmp, s->base + UBRLCR);
/* Enable the UART */
- writel(readl(SYSCON(s)) | SYSCON_UARTEN, SYSCON(s));
+ tmp = readl(s->syscon + SYSCON);
+ writel(tmp | SYSCON_UARTEN, s->syscon + SYSCON);
}
static void clps711x_putc(struct console_device *cdev, char c)
@@ -67,11 +87,11 @@ static void clps711x_putc(struct console_device *cdev, char c)
struct clps711x_uart *s = cdev->dev->priv;
/* Wait until there is space in the FIFO */
- while (readl(SYSFLG(s)) & SYSFLG_UTXFF)
- barrier();
+ do {
+ } while (readl(s->syscon + SYSFLG) & SYSFLG_UTXFF);
/* Send the character */
- writew(c, s->UARTDR);
+ writew(c, s->base + UARTDR);
}
static int clps711x_getc(struct console_device *cdev)
@@ -80,10 +100,10 @@ static int clps711x_getc(struct console_device *cdev)
u16 data;
/* Wait until there is data in the FIFO */
- while (readl(SYSFLG(s)) & SYSFLG_URXFE)
- barrier();
+ do {
+ } while (readl(s->syscon + SYSFLG) & SYSFLG_URXFE);
- data = readw(s->UARTDR);
+ data = readw(s->base + UARTDR);
/* Check for an error flag */
if (data & (UARTDR_FRMERR | UARTDR_PARERR | UARTDR_OVERR))
@@ -96,35 +116,50 @@ static int clps711x_tstc(struct console_device *cdev)
{
struct clps711x_uart *s = cdev->dev->priv;
- return !(readl(SYSFLG(s)) & SYSFLG_URXFE);
+ return !(readl(s->syscon + SYSFLG) & SYSFLG_URXFE);
}
static void clps711x_flush(struct console_device *cdev)
{
struct clps711x_uart *s = cdev->dev->priv;
- while (readl(SYSFLG(s)) & SYSFLG_UBUSY)
- barrier();
+ do {
+ } while (readl(s->syscon + SYSFLG) & SYSFLG_UBUSY);
}
static int clps711x_probe(struct device_d *dev)
{
struct clps711x_uart *s;
- char syscon_dev[18];
+ int err, id = dev->id;
+ char syscon_dev[8];
+
+ if (dev->device_node)
+ id = of_alias_get_id(dev->device_node, "serial");
- BUG_ON(dev->num_resources != 2);
- BUG_ON((dev->id != 0) && (dev->id != 1));
+ if (id != 0 && id != 1)
+ return -EINVAL;
s = xzalloc(sizeof(struct clps711x_uart));
s->uart_clk = clk_get(dev, NULL);
- BUG_ON(IS_ERR(s->uart_clk));
-
- s->UBRLCR = dev_get_mem_region(dev, 0);
- s->UARTDR = dev_get_mem_region(dev, 1);
-
- sprintf(syscon_dev, "clps711x-syscon%i", dev->id + 1);
- s->syscon = syscon_base_lookup_by_pdevname(syscon_dev);
- BUG_ON(IS_ERR(s->syscon));
+ if (IS_ERR(s->uart_clk)) {
+ err = PTR_ERR(s->uart_clk);
+ goto out_err;
+ }
+
+ s->base = dev_get_mem_region(dev, 0);
+
+ if (!dev->device_node) {
+ sprintf(syscon_dev, "syscon%i", id + 1);
+ s->syscon = syscon_base_lookup_by_pdevname(syscon_dev);
+ } else {
+ s->syscon = syscon_base_lookup_by_phandle(dev->device_node,
+ "syscon");
+ }
+
+ if (IS_ERR(s->syscon)) {
+ err = PTR_ERR(s->syscon);
+ goto out_err;
+ }
dev->priv = s;
s->cdev.dev = dev;
@@ -135,7 +170,13 @@ static int clps711x_probe(struct device_d *dev)
s->cdev.setbrg = clps711x_setbaudrate;
clps711x_init_port(&s->cdev);
- return console_register(&s->cdev);
+ err = console_register(&s->cdev);
+
+out_err:
+ if (err)
+ free(s);
+
+ return err;
}
static void clps711x_remove(struct device_d *dev)
@@ -147,9 +188,14 @@ static void clps711x_remove(struct device_d *dev)
free(s);
}
+static struct of_device_id __maybe_unused clps711x_uart_dt_ids[] = {
+ { .compatible = "cirrus,clps711x-uart", },
+};
+
static struct driver_d clps711x_driver = {
- .name = "clps711x_serial",
- .probe = clps711x_probe,
- .remove = clps711x_remove,
+ .name = "clps711x-uart",
+ .probe = clps711x_probe,
+ .remove = clps711x_remove,
+ .of_compatible = DRV_OF_COMPAT(clps711x_uart_dt_ids),
};
console_platform_driver(clps711x_driver);
diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c
index acd9e44df1..6eeef7d8c7 100644
--- a/drivers/usb/gadget/at91_udc.c
+++ b/drivers/usb/gadget/at91_udc.c
@@ -1417,7 +1417,7 @@ static struct poller_struct poller = {
static int __init at91udc_probe(struct device_d *dev)
{
- struct at91_udc *udc;
+ struct at91_udc *udc = &controller;
int retval;
if (!dev->platform_data) {
@@ -1427,7 +1427,6 @@ static int __init at91udc_probe(struct device_d *dev)
}
/* init software state */
- udc = &controller;
udc->dev = dev;
udc->board = *(struct at91_udc_data *) dev->platform_data;
udc->enabled = 0;