* [PATCH] avr32: clean up mci platform code
@ 2008-07-18 6:48 Ben Nizette
2008-07-18 9:04 ` Haavard Skinnemoen
0 siblings, 1 reply; 2+ messages in thread
From: Ben Nizette @ 2008-07-18 6:48 UTC (permalink / raw)
To: Haavard Skinnemoen; +Cc: Pierre Ossman, linux-kernel, kernel
This patch does a few small cleanups around the atmel mci platform code
and in the atmel-mci driver. The platform changes simply removes an
unused variable, uses the fact that by the end we always have some form
of platform data and notes that GPIO_PIN_NONE != 0. This last point
could cause the incorrect attempt to twice reserve pin PA0.
While we've got the hood up, add linux/err.h to the atmel-mci.c include
list. It needs it and generally pulls it by voodoo but I did once
stumble across a config which don't build.
This is against Linus' latest git.
Signed-off-by: Ben Nizette <bn@niasdigital.com>
---
diff --git a/arch/avr32/mach-at32ap/at32ap700x.c b/arch/avr32/mach-at32ap/at32ap700x.c
index 021d512..4ac38d2 100644
--- a/arch/avr32/mach-at32ap/at32ap700x.c
+++ b/arch/avr32/mach-at32ap/at32ap700x.c
@@ -1284,7 +1284,6 @@ at32_add_device_mci(unsigned int id, struct mci_platform_data *data)
{
struct mci_platform_data _data;
struct platform_device *pdev;
- struct dw_dma_slave *dws;
if (id != 0)
return NULL;
@@ -1300,6 +1299,8 @@ at32_add_device_mci(unsigned int id, struct mci_platform_data *data)
if (!data) {
data = &_data;
memset(data, 0, sizeof(struct mci_platform_data));
+ data->detect_pin = GPIO_PIN_NONE;
+ data->wp_pin = GPIO_PIN_NONE;
}
if (platform_device_add_data(pdev, data,
@@ -1313,12 +1314,10 @@ at32_add_device_mci(unsigned int id, struct mci_platform_data *data)
select_peripheral(PA(14), PERIPH_A, 0); /* DATA2 */
select_peripheral(PA(15), PERIPH_A, 0); /* DATA3 */
- if (data) {
- if (data->detect_pin != GPIO_PIN_NONE)
- at32_select_gpio(data->detect_pin, 0);
- if (data->wp_pin != GPIO_PIN_NONE)
- at32_select_gpio(data->wp_pin, 0);
- }
+ if (data->detect_pin != GPIO_PIN_NONE)
+ at32_select_gpio(data->detect_pin, 0);
+ if (data->wp_pin != GPIO_PIN_NONE)
+ at32_select_gpio(data->wp_pin, 0);
atmel_mci0_pclk.dev = &pdev->dev;
diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
index cce873c..c2f8aa8 100644
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
@@ -10,6 +10,7 @@
#include <linux/blkdev.h>
#include <linux/clk.h>
#include <linux/device.h>
+#include <linux/err.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/ioport.h>
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] avr32: clean up mci platform code
2008-07-18 6:48 [PATCH] avr32: clean up mci platform code Ben Nizette
@ 2008-07-18 9:04 ` Haavard Skinnemoen
0 siblings, 0 replies; 2+ messages in thread
From: Haavard Skinnemoen @ 2008-07-18 9:04 UTC (permalink / raw)
To: Ben Nizette; +Cc: Pierre Ossman, linux-kernel, kernel
On Fri, 18 Jul 2008 16:48:09 +1000
Ben Nizette <bn@niasdigital.com> wrote:
> This patch does a few small cleanups around the atmel mci platform code
> and in the atmel-mci driver. The platform changes simply removes an
> unused variable, uses the fact that by the end we always have some form
> of platform data and notes that GPIO_PIN_NONE != 0. This last point
> could cause the incorrect attempt to twice reserve pin PA0.
Indeed. The if (data) check is useless too since we make sure data
always points to something.
We should probably set the invalid pins to something like -EINVAL
eventually, but for now GPIO_PIN_NONE is consistent with everything
else around there.
> While we've got the hood up, add linux/err.h to the atmel-mci.c include
> list. It needs it and generally pulls it by voodoo but I did once
> stumble across a config which don't build.
Yes, including linux/err.h is definitely the right thing to do.
> This is against Linus' latest git.
>
> Signed-off-by: Ben Nizette <bn@niasdigital.com>
I've applied it to the avr32 tree since it touches mostly avr32 arch
code. Thanks a lot, Ben!
Haavard
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-07-18 9:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-18 6:48 [PATCH] avr32: clean up mci platform code Ben Nizette
2008-07-18 9:04 ` Haavard Skinnemoen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox