From 3874b16997d3c0219a9baab3578ba27ec084282b Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Fri, 13 Jan 2012 16:55:24 +0100 Subject: atmel/mci: fix slot_b support in commit commit f60f6c58e atmel_mci: check for device id we use to address the right slot the driver use the dev_id to detect the slot which is wrong on 9263 as we have 2 devices with 2 slots use slot_b paramter to specify the slot as done in linux Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD Cc: Michael Grzeschik Signed-off-by: Sascha Hauer --- drivers/mci/atmel_mci.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/mci/atmel_mci.c b/drivers/mci/atmel_mci.c index 15668fc78b..3c37747ff9 100644 --- a/drivers/mci/atmel_mci.c +++ b/drivers/mci/atmel_mci.c @@ -36,6 +36,7 @@ struct atmel_mci_host { u32 datasize; struct mci_cmd *cmd; struct mci_data *data; + unsigned slot_b; }; #define to_mci_host(mci) container_of(mci, struct atmel_mci_host, mci) @@ -370,7 +371,7 @@ static void mci_set_ios(struct mci_host *mci, struct device_d *mci_dev, break; } atmel_mci_writel(host, AT91_MCI_SDCR, atmel_mci_readl(host, AT91_MCI_SDCR) - | host->hw_dev->id); + | host->slot_b); if (clock) { atmel_set_clk_rate(host, clock); @@ -459,6 +460,7 @@ static int mci_probe(struct device_d *hw_dev) host->mci.host_caps |= MMC_MODE_4BIT; if (pd->bus_width == 8) host->mci.host_caps |= MMC_MODE_8BIT; + host->slot_b = pd->slot_b; host->base = dev_request_mem_region(hw_dev, 0); host->hw_dev = hw_dev; -- cgit v1.2.3 From 8d6bfdaec7c3ce44969ca0930b84442ff93cd80b Mon Sep 17 00:00:00 2001 From: Robert Jarzmik Date: Fri, 20 Jan 2012 21:17:24 +0100 Subject: usb/gadget: fix poller NPE in early polling The timings of the poller calling have changed, digging out a latent bug in pxa27x udc controller. The polling routine is called before the probe function is called, and the driver internal are not initialized at that time. This triggers a NULL pointer exception. Fix it by moving poller registration after driver probe. Signed-off-by: Robert Jarzmik Signed-off-by: Sascha Hauer --- drivers/usb/gadget/pxa27x_udc.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'drivers') diff --git a/drivers/usb/gadget/pxa27x_udc.c b/drivers/usb/gadget/pxa27x_udc.c index d0dbee9824..56525559f6 100644 --- a/drivers/usb/gadget/pxa27x_udc.c +++ b/drivers/usb/gadget/pxa27x_udc.c @@ -1473,6 +1473,14 @@ static struct pxa_udc memory = { } }; +static int pxa27x_udc_poller(struct poller_struct *poller) +{ + return usb_gadget_poll(); +} +static struct poller_struct poller = { + .func = pxa27x_udc_poller +}; + static int __init pxa_udc_probe(struct device_d *dev) { struct pxa_udc *udc = &memory; @@ -1496,6 +1504,8 @@ static int __init pxa_udc_probe(struct device_d *dev) the_controller = udc; udc_init_data(udc); pxa_eps_setup(udc); + poller_register(&poller); + return 0; } @@ -1506,18 +1516,9 @@ static struct driver_d udc_driver = { .probe = pxa_udc_probe, }; -static int pxa27x_udc_poller(struct poller_struct *poller) -{ - return usb_gadget_poll(); -} -static struct poller_struct poller = { - .func = pxa27x_udc_poller -}; - static int __init pxa27x_udc_init(void) { register_driver(&udc_driver); - poller_register(&poller); return 0; } -- cgit v1.2.3