ARM: imx: cleanup otg_mode
Subsystems (3)
PATCH 1/1 ARM: imx: cleanup otg_mode
Cleanup the code for the otg_mode command line param:
* Use the bool type as it applies here.
* Qualify otg_mode_host with __initdata since this variable is only used in this context.
* The __setup functions are not supposed to return a status code, but a boolean indicating whether the param has been handled. See obsolete_checksetup() in init/main.c.
--- .../arch/arm/mach-imx/mach-cpuimx27.c | 8 ++++---- .../arch/arm/mach-imx/mach-cpuimx35.c | 8 ++++---- .../arch/arm/mach-imx/mach-cpuimx51sd.c | 8 ++++---- .../arch/arm/mach-imx/mach-eukrea_cpuimx25.c | 8 ++++---- .../arch/arm/mach-imx/mach-mx27_3ds.c | 8 ++++---- .../arch/arm/mach-imx/mach-mx31_3ds.c | 8 ++++---- .../arch/arm/mach-imx/mach-mx35_3ds.c | 8 ++++---- .../arch/arm/mach-imx/mach-mx51_babbage.c | 8 ++++---- .../arch/arm/mach-imx/mach-pca100.c | 8 ++++---- .../arch/arm/mach-imx/mach-pcm037.c | 8 ++++---- .../arch/arm/mach-imx/mach-pcm043.c | 8 ++++---- 11 files changed, 44 insertions(+), 44 deletions(-)
arch/arm/mach-imx/mach-cpuimx27.c +4 -4
@@ -233,18 +233,18 @@ static const struct fsl_usb2_platform_data otg_device_pdata __initconst = { .phy_mode = FSL_USB2_PHY_ULPI, }; -static int otg_mode_host; +static bool otg_mode_host__initdata ;static int __init eukrea_cpuimx27_otg_mode (char *options) {if (!strcmp (options,"host" )) - otg_mode_host =1 ; + otg_mode_host = true;else if (!strcmp (options,"device" )) - otg_mode_host =0 ; + otg_mode_host = false;else pr_info ("otg_mode neither \"host\" nor \"device\". " "Defaulting to device\n" ); -return 0 ; +return 1 ; }__setup ("otg_mode=" , eukrea_cpuimx27_otg_mode);
arch/arm/mach-imx/mach-cpuimx35.c +4 -4
@@ -141,18 +141,18 @@ static const struct fsl_usb2_platform_data otg_device_pdata __initconst = { .workaround = FLS_USB2_WORKAROUND_ENGCM09152, }; -static int otg_mode_host; +static bool otg_mode_host__initdata ;static int __init eukrea_cpuimx35_otg_mode (char *options) {if (!strcmp (options,"host" )) - otg_mode_host =1 ; + otg_mode_host = true;else if (!strcmp (options,"device" )) - otg_mode_host =0 ; + otg_mode_host = false;else pr_info ("otg_mode neither \"host\" nor \"device\". " "Defaulting to device\n" ); -return 0 ; +return 1 ; }__setup ("otg_mode=" , eukrea_cpuimx35_otg_mode);
arch/arm/mach-imx/mach-cpuimx51sd.c +4 -4
@@ -217,18 +217,18 @@ static const struct mxc_usbh_platform_data usbh1_config __initconst = { .portsc = MXC_EHCI_MODE_ULPI, }; -static int otg_mode_host; +static bool otg_mode_host__initdata ;static int __init eukrea_cpuimx51sd_otg_mode (char *options) {if (!strcmp (options,"host" )) - otg_mode_host =1 ; + otg_mode_host = true;else if (!strcmp (options,"device" )) - otg_mode_host =0 ; + otg_mode_host = false;else pr_info ("otg_mode neither \"host\" nor \"device\". " "Defaulting to device\n" ); -return 0 ; +return 1 ; }__setup ("otg_mode=" , eukrea_cpuimx51sd_otg_mode);
arch/arm/mach-imx/mach-eukrea_cpuimx25.c +4 -4
@@ -109,18 +109,18 @@ static const struct fsl_usb2_platform_data otg_device_pdata __initconst = { .workaround = FLS_USB2_WORKAROUND_ENGCM09152, }; -static int otg_mode_host; +static bool otg_mode_host__initdata ;static int __init eukrea_cpuimx25_otg_mode (char *options) {if (!strcmp (options,"host" )) - otg_mode_host =1 ; + otg_mode_host = true;else if (!strcmp (options,"device" )) - otg_mode_host =0 ; + otg_mode_host = false;else pr_info ("otg_mode neither \"host\" nor \"device\". " "Defaulting to device\n" ); -return 0 ; +return 1 ; }__setup ("otg_mode=" , eukrea_cpuimx25_otg_mode);
arch/arm/mach-imx/mach-mx27_3ds.c +4 -4
@@ -241,18 +241,18 @@ static const struct fsl_usb2_platform_data otg_device_pdata __initconst = { .phy_mode = FSL_USB2_PHY_ULPI, }; -static int otg_mode_host; +static bool otg_mode_host__initdata ;static int __init mx27_3ds_otg_mode (char *options) {if (!strcmp (options,"host" )) - otg_mode_host =1 ; + otg_mode_host = true;else if (!strcmp (options,"device" )) - otg_mode_host =0 ; + otg_mode_host = false;else pr_info ("otg_mode neither \"host\" nor \"device\". " "Defaulting to device\n" ); -return 0 ; +return 1 ; }__setup ("otg_mode=" , mx27_3ds_otg_mode);
arch/arm/mach-imx/mach-mx31_3ds.c +4 -4
@@ -671,18 +671,18 @@ static const struct fsl_usb2_platform_data usbotg_pdata __initconst = { .phy_mode = FSL_USB2_PHY_ULPI, }; -static int otg_mode_host; +static bool otg_mode_host__initdata ;static int __init mx31_3ds_otg_mode (char *options) {if (!strcmp (options,"host" )) - otg_mode_host =1 ; + otg_mode_host = true;else if (!strcmp (options,"device" )) - otg_mode_host =0 ; + otg_mode_host = false;else pr_info ("otg_mode neither \"host\" nor \"device\". " "Defaulting to device\n" ); -return 0 ; +return 1 ; }__setup ("otg_mode=" , mx31_3ds_otg_mode);
arch/arm/mach-imx/mach-mx35_3ds.c +4 -4
@@ -540,18 +540,18 @@ static const struct mxc_usbh_platform_data usb_host_pdata __initconst = { .portsc = MXC_EHCI_MODE_SERIAL, }; -static int otg_mode_host; +static bool otg_mode_host__initdata ;static int __init mx35_3ds_otg_mode (char *options) {if (!strcmp (options,"host" )) - otg_mode_host =1 ; + otg_mode_host = true;else if (!strcmp (options,"device" )) - otg_mode_host =0 ; + otg_mode_host = false;else pr_info ("otg_mode neither \"host\" nor \"device\". " "Defaulting to device\n" ); -return 0 ; +return 1 ; }__setup ("otg_mode=" , mx35_3ds_otg_mode);
arch/arm/mach-imx/mach-mx51_babbage.c +4 -4
@@ -307,18 +307,18 @@ static const struct mxc_usbh_platform_data usbh1_config __initconst = { .portsc = MXC_EHCI_MODE_ULPI, }; -static int otg_mode_host; +static bool otg_mode_host__initdata ;static int __init babbage_otg_mode (char *options) {if (!strcmp (options,"host" )) - otg_mode_host =1 ; + otg_mode_host = true;else if (!strcmp (options,"device" )) - otg_mode_host =0 ; + otg_mode_host = false;else pr_info ("otg_mode neither \"host\" nor \"device\". " "Defaulting to device\n" ); -return 0 ; +return 1 ; }__setup ("otg_mode=" , babbage_otg_mode);
arch/arm/mach-imx/mach-pca100.c +4 -4
@@ -298,18 +298,18 @@ static const struct fsl_usb2_platform_data otg_device_pdata __initconst = { .phy_mode = FSL_USB2_PHY_ULPI, }; -static int otg_mode_host; +static bool otg_mode_host__initdata ;static int __init pca100_otg_mode (char *options) {if (!strcmp (options,"host" )) - otg_mode_host =1 ; + otg_mode_host = true;else if (!strcmp (options,"device" )) - otg_mode_host =0 ; + otg_mode_host = false;else pr_info ("otg_mode neither \"host\" nor \"device\". " "Defaulting to device\n" ); -return 0 ; +return 1 ; }__setup ("otg_mode=" , pca100_otg_mode);
arch/arm/mach-imx/mach-pcm037.c +4 -4
@@ -557,18 +557,18 @@ static const struct fsl_usb2_platform_data otg_device_pdata __initconst = { .phy_mode = FSL_USB2_PHY_ULPI, }; -static int otg_mode_host; +static bool otg_mode_host__initdata ;static int __init pcm037_otg_mode (char *options) {if (!strcmp (options,"host" )) - otg_mode_host =1 ; + otg_mode_host = true;else if (!strcmp (options,"device" )) - otg_mode_host =0 ; + otg_mode_host = false;else pr_info ("otg_mode neither \"host\" nor \"device\". " "Defaulting to device\n" ); -return 0 ; +return 1 ; }__setup ("otg_mode=" , pcm037_otg_mode);
arch/arm/mach-imx/mach-pcm043.c +4 -4
@@ -330,18 +330,18 @@ static const struct fsl_usb2_platform_data otg_device_pdata __initconst = { .phy_mode = FSL_USB2_PHY_UTMI, }; -static int otg_mode_host; +static bool otg_mode_host__initdata ;static int __init pcm043_otg_mode (char *options) {if (!strcmp (options,"host" )) - otg_mode_host =1 ; + otg_mode_host = true;else if (!strcmp (options,"device" )) - otg_mode_host =0 ; + otg_mode_host = false;else pr_info ("otg_mode neither \"host\" nor \"device\". " "Defaulting to device\n" ); -return 0 ; +return 1 ; }__setup ("otg_mode=" , pcm043_otg_mode);
PATCH 1/1 ARM: imx: cleanup otg_mode
Quoted 9 lines · Beno?t Th?baudeau
Cleanup the code for the
otg_modecommand line param:
* Use the bool type as it applies here.
* Qualifyotg_mode_hostwith__initdatasince this variable is only used in this context.
* The__setupfunctions are not supposed to return a status code, but a boolean indicating whether the param has been handled. Seeobsolete_checksetup()ininit/main.c.Signed-off-by Beno?t Th?baudeau <[email protected]>
Applied as cleanup.
Thanks
Sascha
Quoted 312 lines
--- .../arch/arm/mach-imx/mach-cpuimx27.c | 8 ++++---- .../arch/arm/mach-imx/mach-cpuimx35.c | 8 ++++---- .../arch/arm/mach-imx/mach-cpuimx51sd.c | 8 ++++---- .../arch/arm/mach-imx/mach-eukrea_cpuimx25.c | 8 ++++---- .../arch/arm/mach-imx/mach-mx27_3ds.c | 8 ++++---- .../arch/arm/mach-imx/mach-mx31_3ds.c | 8 ++++---- .../arch/arm/mach-imx/mach-mx35_3ds.c | 8 ++++---- .../arch/arm/mach-imx/mach-mx51_babbage.c | 8 ++++---- .../arch/arm/mach-imx/mach-pca100.c | 8 ++++---- .../arch/arm/mach-imx/mach-pcm037.c | 8 ++++---- .../arch/arm/mach-imx/mach-pcm043.c | 8 ++++---- 11 files changed, 44 insertions(+), 44 deletions(-)arch/arm/mach-imx/mach-cpuimx27.c +4
-4@@ -233,18 +233,18 @@ static const struct fsl_usb2_platform_data otg_device_pdata __initconst = { .phy_mode = FSL_USB2_PHY_ULPI, }; -static int otg_mode_host; +static bool otg_mode_host__initdata ;static int __init eukrea_cpuimx27_otg_mode (char *options) {if (!strcmp (options,"host" )) - otg_mode_host =1 ; + otg_mode_host = true;else if (!strcmp (options,"device" )) - otg_mode_host =0 ; + otg_mode_host = false;else pr_info ("otg_mode neither \"host\" nor \"device\". " "Defaulting to device\n" ); -return 0 ; +return 1 ; }__setup ("otg_mode=" , eukrea_cpuimx27_otg_mode);arch/arm/mach-imx/mach-cpuimx35.c +4
-4@@ -141,18 +141,18 @@ static const struct fsl_usb2_platform_data otg_device_pdata __initconst = { .workaround = FLS_USB2_WORKAROUND_ENGCM09152, }; -static int otg_mode_host; +static bool otg_mode_host__initdata ;static int __init eukrea_cpuimx35_otg_mode (char *options) {if (!strcmp (options,"host" )) - otg_mode_host =1 ; + otg_mode_host = true;else if (!strcmp (options,"device" )) - otg_mode_host =0 ; + otg_mode_host = false;else pr_info ("otg_mode neither \"host\" nor \"device\". " "Defaulting to device\n" ); -return 0 ; +return 1 ; }__setup ("otg_mode=" , eukrea_cpuimx35_otg_mode);arch/arm/mach-imx/mach-cpuimx51sd.c +4
-4@@ -217,18 +217,18 @@ static const struct mxc_usbh_platform_data usbh1_config __initconst = { .portsc = MXC_EHCI_MODE_ULPI, }; -static int otg_mode_host; +static bool otg_mode_host__initdata ;static int __init eukrea_cpuimx51sd_otg_mode (char *options) {if (!strcmp (options,"host" )) - otg_mode_host =1 ; + otg_mode_host = true;else if (!strcmp (options,"device" )) - otg_mode_host =0 ; + otg_mode_host = false;else pr_info ("otg_mode neither \"host\" nor \"device\". " "Defaulting to device\n" ); -return 0 ; +return 1 ; }__setup ("otg_mode=" , eukrea_cpuimx51sd_otg_mode);arch/arm/mach-imx/mach-eukrea_cpuimx25.c +4
-4@@ -109,18 +109,18 @@ static const struct fsl_usb2_platform_data otg_device_pdata __initconst = { .workaround = FLS_USB2_WORKAROUND_ENGCM09152, }; -static int otg_mode_host; +static bool otg_mode_host__initdata ;static int __init eukrea_cpuimx25_otg_mode (char *options) {if (!strcmp (options,"host" )) - otg_mode_host =1 ; + otg_mode_host = true;else if (!strcmp (options,"device" )) - otg_mode_host =0 ; + otg_mode_host = false;else pr_info ("otg_mode neither \"host\" nor \"device\". " "Defaulting to device\n" ); -return 0 ; +return 1 ; }__setup ("otg_mode=" , eukrea_cpuimx25_otg_mode);arch/arm/mach-imx/mach-mx27_3ds.c +4
-4@@ -241,18 +241,18 @@ static const struct fsl_usb2_platform_data otg_device_pdata __initconst = { .phy_mode = FSL_USB2_PHY_ULPI, }; -static int otg_mode_host; +static bool otg_mode_host__initdata ;static int __init mx27_3ds_otg_mode (char *options) {if (!strcmp (options,"host" )) - otg_mode_host =1 ; + otg_mode_host = true;else if (!strcmp (options,"device" )) - otg_mode_host =0 ; + otg_mode_host = false;else pr_info ("otg_mode neither \"host\" nor \"device\". " "Defaulting to device\n" ); -return 0 ; +return 1 ; }__setup ("otg_mode=" , mx27_3ds_otg_mode);arch/arm/mach-imx/mach-mx31_3ds.c +4
-4@@ -671,18 +671,18 @@ static const struct fsl_usb2_platform_data usbotg_pdata __initconst = { .phy_mode = FSL_USB2_PHY_ULPI, }; -static int otg_mode_host; +static bool otg_mode_host__initdata ;static int __init mx31_3ds_otg_mode (char *options) {if (!strcmp (options,"host" )) - otg_mode_host =1 ; + otg_mode_host = true;else if (!strcmp (options,"device" )) - otg_mode_host =0 ; + otg_mode_host = false;else pr_info ("otg_mode neither \"host\" nor \"device\". " "Defaulting to device\n" ); -return 0 ; +return 1 ; }__setup ("otg_mode=" , mx31_3ds_otg_mode);arch/arm/mach-imx/mach-mx35_3ds.c +4
-4@@ -540,18 +540,18 @@ static const struct mxc_usbh_platform_data usb_host_pdata __initconst = { .portsc = MXC_EHCI_MODE_SERIAL, }; -static int otg_mode_host; +static bool otg_mode_host__initdata ;static int __init mx35_3ds_otg_mode (char *options) {if (!strcmp (options,"host" )) - otg_mode_host =1 ; + otg_mode_host = true;else if (!strcmp (options,"device" )) - otg_mode_host =0 ; + otg_mode_host = false;else pr_info ("otg_mode neither \"host\" nor \"device\". " "Defaulting to device\n" ); -return 0 ; +return 1 ; }__setup ("otg_mode=" , mx35_3ds_otg_mode);arch/arm/mach-imx/mach-mx51_babbage.c +4
-4@@ -307,18 +307,18 @@ static const struct mxc_usbh_platform_data usbh1_config __initconst = { .portsc = MXC_EHCI_MODE_ULPI, }; -static int otg_mode_host; +static bool otg_mode_host__initdata ;static int __init babbage_otg_mode (char *options) {if (!strcmp (options,"host" )) - otg_mode_host =1 ; + otg_mode_host = true;else if (!strcmp (options,"device" )) - otg_mode_host =0 ; + otg_mode_host = false;else pr_info ("otg_mode neither \"host\" nor \"device\". " "Defaulting to device\n" ); -return 0 ; +return 1 ; }__setup ("otg_mode=" , babbage_otg_mode);arch/arm/mach-imx/mach-pca100.c +4
-4@@ -298,18 +298,18 @@ static const struct fsl_usb2_platform_data otg_device_pdata __initconst = { .phy_mode = FSL_USB2_PHY_ULPI, }; -static int otg_mode_host; +static bool otg_mode_host__initdata ;static int __init pca100_otg_mode (char *options) {if (!strcmp (options,"host" )) - otg_mode_host =1 ; + otg_mode_host = true;else if (!strcmp (options,"device" )) - otg_mode_host =0 ; + otg_mode_host = false;else pr_info ("otg_mode neither \"host\" nor \"device\". " "Defaulting to device\n" ); -return 0 ; +return 1 ; }__setup ("otg_mode=" , pca100_otg_mode);arch/arm/mach-imx/mach-pcm037.c +4
-4@@ -557,18 +557,18 @@ static const struct fsl_usb2_platform_data otg_device_pdata __initconst = { .phy_mode = FSL_USB2_PHY_ULPI, }; -static int otg_mode_host; +static bool otg_mode_host__initdata ;static int __init pcm037_otg_mode (char *options) {if (!strcmp (options,"host" )) - otg_mode_host =1 ; + otg_mode_host = true;else if (!strcmp (options,"device" )) - otg_mode_host =0 ; + otg_mode_host = false;else pr_info ("otg_mode neither \"host\" nor \"device\". " "Defaulting to device\n" ); -return 0 ; +return 1 ; }__setup ("otg_mode=" , pcm037_otg_mode);arch/arm/mach-imx/mach-pcm043.c +4
-4@@ -330,18 +330,18 @@ static const struct fsl_usb2_platform_data otg_device_pdata __initconst = { .phy_mode = FSL_USB2_PHY_UTMI, }; -static int otg_mode_host; +static bool otg_mode_host__initdata ;static int __init pcm043_otg_mode (char *options) {if (!strcmp (options,"host" )) - otg_mode_host =1 ; + otg_mode_host = true;else if (!strcmp (options,"device" )) - otg_mode_host =0 ; + otg_mode_host = false;else pr_info ("otg_mode neither \"host\" nor \"device\". " "Defaulting to device\n" ); -return 0 ; +return 1 ; }__setup ("otg_mode=" , pcm043_otg_mode);
Signature · 4 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |