Re: [PATCH 05/11 v3] ARM: pxa: Add gpio descriptor lookup tables for MMC CD/WP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Linus Walleij <linus.walleij@xxxxxxxxxx> writes:

Hi Linus,

> diff --git a/arch/arm/mach-pxa/cm-x270.c b/arch/arm/mach-pxa/cm-x270.c
> index be4a66166d61..8c127a1cf5ed 100644
> --- a/arch/arm/mach-pxa/cm-x270.c
> +++ b/arch/arm/mach-pxa/cm-x270.c
> @@ -12,6 +12,7 @@
>  #include <linux/platform_device.h>
>  #include <linux/irq.h>
>  #include <linux/gpio.h>
> +#include <linux/gpio/machine.h>
>  #include <linux/delay.h>
>  
>  #include <linux/platform_data/rtc-v3020.h>
> @@ -294,8 +295,18 @@ static struct pxamci_platform_data cmx270_mci_platform_data = {
>  	.gpio_power_invert	= 1,
>  };
>  
> +static struct gpiod_lookup_table cmx270_mci_gpio_table = {
> +	.dev_id = "pxa2xx-mci.0",
> +	.table = {
> +		/* Card detect on GPIO 83 */
> +		GPIO_LOOKUP("gpio-pxa", 83, "cd", GPIO_ACTIVE_LOW),
This 83 magic number escaped your third pass, that was the "Don't use number,
only defines." comment in the former iteration. I think that applies to other
parts of this patch :
+static struct gpiod_lookup_table cm_x300_mci_gpio_table = {
+static struct gpiod_lookup_table income_mci_gpio_table = {
+static struct gpiod_lookup_table littleton_mci_gpio_table = {
+static struct gpiod_lookup_table mioa701_mci_gpio_table = {
+static struct gpiod_lookup_table mxm_8x10_mci_gpio_table = {

>  static void __init colibri_mmc_init(void)
>  {
>  	if (machine_is_colibri())	/* PXA270 Colibri */
>  		colibri_mci_platform_data.gpio_card_detect =
>  			GPIO0_COLIBRI_PXA270_SD_DETECT;
> +		gpiod_add_lookup_table(&colibri_pxa270_mci_gpio_table);
This looks weird. Either the indentation of the gpiod_add_lookup_table() is
wrong, or more probably the assignment above is to be removed in a next patch.
I wouldn't mind having the condition repeated to ease the next patch, ie:
 	if (machine_is_colibri())	/* PXA270 Colibri */
 		colibri_mci_platform_data.gpio_card_detect =
 			GPIO0_COLIBRI_PXA270_SD_DETECT;
 	if (machine_is_colibri())	/* PXA270 Colibri */
		gpiod_add_lookup_table(&colibri_pxa270_mci_gpio_table);

>  	if (machine_is_colibri300())	/* PXA300 Colibri */
>  		colibri_mci_platform_data.gpio_card_detect =
>  			GPIO13_COLIBRI_PXA300_SD_DETECT;
> +		gpiod_add_lookup_table(&colibri_pxa300_mci_gpio_table);
>  	else				/* PXA320 Colibri */
>  		colibri_mci_platform_data.gpio_card_detect =
>  			GPIO28_COLIBRI_PXA320_SD_DETECT;
> +		gpiod_add_lookup_table(&colibri_pxa320_mci_gpio_table);
Same comment here.

>  static int em_x270_mci_init(struct device *dev,
>  			    irq_handler_t em_x270_detect_int,
>  			    void *data)
> @@ -644,6 +654,7 @@ static void __init em_x270_init_mmc(void)
>  {
>  	if (machine_is_em_x270())
>  		em_x270_mci_platform_data.get_ro = em_x270_mci_get_ro;
> +		gpiod_add_lookup_table(&em_x270_mci_wp_gpio_table);
Same comment here.

Cheers.

-- 
Robert



[Index of Archives]     [Linux Memonry Technology]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux