diff mbox

[V2,6/6] gpio: davinci: Remove redundant macros

Message ID 1484281215-24576-7-git-send-email-j-keerthy@ti.com
State New
Headers show

Commit Message

J, KEERTHY Jan. 13, 2017, 4:20 a.m. UTC
Some of the macros were needed as per old driver design.
With the current implementation they are unwanted. Hence remove
them.

Signed-off-by: Keerthy <j-keerthy@ti.com>
---
 include/linux/platform_data/gpio-davinci.h | 8 --------
 1 file changed, 8 deletions(-)

Comments

kernel test robot Jan. 15, 2017, 4:31 a.m. UTC | #1
Hi Keerthy,

[auto build test ERROR on gpio/for-next]
[also build test ERROR on next-20170113]
[cannot apply to v4.10-rc3]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Keerthy/gpio-davinci-Redesign-driver-to-accommodate-ngpios-in-one-gpio-chip/20170114-204048
base:   https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git for-next
config: arm-davinci_all_defconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=arm 

All error/warnings (new ones prefixed by >>):

>> arch/arm/mach-davinci/board-neuros-osd2.c:131:34: error: implicit declaration of function 'GPIO' [-Werror=implicit-function-declaration]
     { .name = "led1_green", .gpio = GPIO(10), },
                                     ^~~~
>> arch/arm/mach-davinci/board-neuros-osd2.c:131:34: error: initializer element is not constant
   arch/arm/mach-davinci/board-neuros-osd2.c:131:34: note: (near initialization for 'ntosd2_leds[0].gpio')
   arch/arm/mach-davinci/board-neuros-osd2.c:132:34: error: initializer element is not constant
     { .name = "led1_red",   .gpio = GPIO(11), },
                                     ^~~~
   arch/arm/mach-davinci/board-neuros-osd2.c:132:34: note: (near initialization for 'ntosd2_leds[1].gpio')
   arch/arm/mach-davinci/board-neuros-osd2.c:133:34: error: initializer element is not constant
     { .name = "led2_green", .gpio = GPIO(12), },
                                     ^~~~
   arch/arm/mach-davinci/board-neuros-osd2.c:133:34: note: (near initialization for 'ntosd2_leds[2].gpio')
   arch/arm/mach-davinci/board-neuros-osd2.c:134:34: error: initializer element is not constant
     { .name = "led2_red",   .gpio = GPIO(13), },
                                     ^~~~
   arch/arm/mach-davinci/board-neuros-osd2.c:134:34: note: (near initialization for 'ntosd2_leds[3].gpio')
   cc1: some warnings being treated as errors
--
   arch/arm/mach-davinci/board-da830-evm.c: In function 'da830_evm_usb_set_power':
>> arch/arm/mach-davinci/board-da830-evm.c:45:23: error: implicit declaration of function 'GPIO_TO_PIN' [-Werror=implicit-function-declaration]
    #define ON_BD_USB_DRV GPIO_TO_PIN(1, 15)
                          ^
>> arch/arm/mach-davinci/board-da830-evm.c:57:17: note: in expansion of macro 'ON_BD_USB_DRV'
     gpio_set_value(ON_BD_USB_DRV, on);
                    ^~~~~~~~~~~~~
   cc1: some warnings being treated as errors
--
   arch/arm/mach-davinci/board-da850-evm.c: In function 'da850_panel_power_ctrl':
>> arch/arm/mach-davinci/board-da850-evm.c:58:27: error: implicit declaration of function 'GPIO_TO_PIN' [-Werror=implicit-function-declaration]
    #define DA850_LCD_BL_PIN  GPIO_TO_PIN(2, 15)
                              ^
>> arch/arm/mach-davinci/board-da850-evm.c:790:17: note: in expansion of macro 'DA850_LCD_BL_PIN'
     gpio_set_value(DA850_LCD_BL_PIN, val);
                    ^~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors
--
   arch/arm/mach-davinci/board-omapl138-hawk.c: In function 'hawk_usb_set_power':
>> arch/arm/mach-davinci/board-omapl138-hawk.c:30:30: error: implicit declaration of function 'GPIO_TO_PIN' [-Werror=implicit-function-declaration]
    #define DA850_USB1_VBUS_PIN  GPIO_TO_PIN(2, 4)
                                 ^
>> arch/arm/mach-davinci/board-omapl138-hawk.c:174:17: note: in expansion of macro 'DA850_USB1_VBUS_PIN'
     gpio_set_value(DA850_USB1_VBUS_PIN, on);
                    ^~~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors

vim +/GPIO_TO_PIN +45 arch/arm/mach-davinci/board-da830-evm.c

8593790d Mark A. Greer     2009-06-03  39  #include <mach/da8xx.h>
8593790d Mark A. Greer     2009-06-03  40  
782f2d78 Cyril Chemparathy 2010-09-15  41  #define DA830_EVM_PHY_ID		""
0e9a3ddc Sergei Shtylyov   2009-09-25  42  /*
0e9a3ddc Sergei Shtylyov   2009-09-25  43   * USB1 VBUS is controlled by GPIO1[15], over-current is reported on GPIO2[4].
0e9a3ddc Sergei Shtylyov   2009-09-25  44   */
0e9a3ddc Sergei Shtylyov   2009-09-25 @45  #define ON_BD_USB_DRV	GPIO_TO_PIN(1, 15)
0e9a3ddc Sergei Shtylyov   2009-09-25  46  #define ON_BD_USB_OVC	GPIO_TO_PIN(2, 4)
0e9a3ddc Sergei Shtylyov   2009-09-25  47  
0e9a3ddc Sergei Shtylyov   2009-09-25  48  static const short da830_evm_usb11_pins[] = {
0e9a3ddc Sergei Shtylyov   2009-09-25  49  	DA830_GPIO1_15, DA830_GPIO2_4,
0e9a3ddc Sergei Shtylyov   2009-09-25  50  	-1
0e9a3ddc Sergei Shtylyov   2009-09-25  51  };
0e9a3ddc Sergei Shtylyov   2009-09-25  52  
0e9a3ddc Sergei Shtylyov   2009-09-25  53  static da8xx_ocic_handler_t da830_evm_usb_ocic_handler;
0e9a3ddc Sergei Shtylyov   2009-09-25  54  
0e9a3ddc Sergei Shtylyov   2009-09-25  55  static int da830_evm_usb_set_power(unsigned port, int on)
0e9a3ddc Sergei Shtylyov   2009-09-25  56  {
0e9a3ddc Sergei Shtylyov   2009-09-25 @57  	gpio_set_value(ON_BD_USB_DRV, on);
0e9a3ddc Sergei Shtylyov   2009-09-25  58  	return 0;
0e9a3ddc Sergei Shtylyov   2009-09-25  59  }
0e9a3ddc Sergei Shtylyov   2009-09-25  60  

:::::: The code at line 45 was first introduced by commit
:::::: 0e9a3ddc91882a19e255dceb18b712f57e3bb731 davinci: DA830 EVM: OHCI platform code

:::::: TO: Sergei Shtylyov <sshtylyov@ru.mvista.com>
:::::: CC: Kevin Hilman <khilman@deeprootsystems.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
J, KEERTHY Jan. 16, 2017, 6:57 a.m. UTC | #2
Linus,

On Friday 13 January 2017 09:50 AM, Keerthy wrote:
> Some of the macros were needed as per old driver design.
> With the current implementation they are unwanted. Hence remove
> them.

Seems like Macros are being used in:
arch/arm/mach-davinci/board-neuros-osd2.c

So this patch can be dropped from the series.

>
> Signed-off-by: Keerthy <j-keerthy@ti.com>
> ---
>  include/linux/platform_data/gpio-davinci.h | 8 --------
>  1 file changed, 8 deletions(-)
>
> diff --git a/include/linux/platform_data/gpio-davinci.h b/include/linux/platform_data/gpio-davinci.h
> index 90ae19c..f922601 100644
> --- a/include/linux/platform_data/gpio-davinci.h
> +++ b/include/linux/platform_data/gpio-davinci.h
> @@ -45,14 +45,6 @@ struct davinci_gpio_controller {
>  	unsigned int		base;
>  };
>
> -/*
> - * basic gpio routines
> - */
> -#define	GPIO(X)		(X)	/* 0 <= X <= (DAVINCI_N_GPIO - 1) */
> -
> -/* Convert GPIO signal to GPIO pin number */
> -#define GPIO_TO_PIN(bank, gpio)	(16 * (bank) + (gpio))
> -
>  static inline u32 __gpio_mask(unsigned gpio)
>  {
>  	return 1 << (gpio % 32);
>
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/include/linux/platform_data/gpio-davinci.h b/include/linux/platform_data/gpio-davinci.h
index 90ae19c..f922601 100644
--- a/include/linux/platform_data/gpio-davinci.h
+++ b/include/linux/platform_data/gpio-davinci.h
@@ -45,14 +45,6 @@  struct davinci_gpio_controller {
 	unsigned int		base;
 };
 
-/*
- * basic gpio routines
- */
-#define	GPIO(X)		(X)	/* 0 <= X <= (DAVINCI_N_GPIO - 1) */
-
-/* Convert GPIO signal to GPIO pin number */
-#define GPIO_TO_PIN(bank, gpio)	(16 * (bank) + (gpio))
-
 static inline u32 __gpio_mask(unsigned gpio)
 {
 	return 1 << (gpio % 32);