Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 33a264dd authored by Benoît Thébaudeau's avatar Benoît Thébaudeau Committed by Sascha Hauer
Browse files

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.

Signed-off-by: default avatarBenoît Thébaudeau <benoit.thebaudeau@advansee.com>
Signed-off-by: default avatarSascha Hauer <s.hauer@pengutronix.de>
parent cfaf0251
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -233,18 +233,18 @@ static const struct fsl_usb2_platform_data otg_device_pdata __initconst = {
	.phy_mode       = FSL_USB2_PHY_ULPI,
	.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)
static int __init eukrea_cpuimx27_otg_mode(char *options)
{
{
	if (!strcmp(options, "host"))
	if (!strcmp(options, "host"))
		otg_mode_host = 1;
		otg_mode_host = true;
	else if (!strcmp(options, "device"))
	else if (!strcmp(options, "device"))
		otg_mode_host = 0;
		otg_mode_host = false;
	else
	else
		pr_info("otg_mode neither \"host\" nor \"device\". "
		pr_info("otg_mode neither \"host\" nor \"device\". "
			"Defaulting to device\n");
			"Defaulting to device\n");
	return 0;
	return 1;
}
}
__setup("otg_mode=", eukrea_cpuimx27_otg_mode);
__setup("otg_mode=", eukrea_cpuimx27_otg_mode);


+4 −4
Original line number Original line Diff line number Diff line
@@ -142,18 +142,18 @@ static const struct fsl_usb2_platform_data otg_device_pdata __initconst = {
	.workaround	= FLS_USB2_WORKAROUND_ENGCM09152,
	.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)
static int __init eukrea_cpuimx35_otg_mode(char *options)
{
{
	if (!strcmp(options, "host"))
	if (!strcmp(options, "host"))
		otg_mode_host = 1;
		otg_mode_host = true;
	else if (!strcmp(options, "device"))
	else if (!strcmp(options, "device"))
		otg_mode_host = 0;
		otg_mode_host = false;
	else
	else
		pr_info("otg_mode neither \"host\" nor \"device\". "
		pr_info("otg_mode neither \"host\" nor \"device\". "
			"Defaulting to device\n");
			"Defaulting to device\n");
	return 0;
	return 1;
}
}
__setup("otg_mode=", eukrea_cpuimx35_otg_mode);
__setup("otg_mode=", eukrea_cpuimx35_otg_mode);


+4 −4
Original line number Original line Diff line number Diff line
@@ -218,18 +218,18 @@ static const struct mxc_usbh_platform_data usbh1_config __initconst = {
	.portsc	= MXC_EHCI_MODE_ULPI,
	.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)
static int __init eukrea_cpuimx51sd_otg_mode(char *options)
{
{
	if (!strcmp(options, "host"))
	if (!strcmp(options, "host"))
		otg_mode_host = 1;
		otg_mode_host = true;
	else if (!strcmp(options, "device"))
	else if (!strcmp(options, "device"))
		otg_mode_host = 0;
		otg_mode_host = false;
	else
	else
		pr_info("otg_mode neither \"host\" nor \"device\". "
		pr_info("otg_mode neither \"host\" nor \"device\". "
			"Defaulting to device\n");
			"Defaulting to device\n");
	return 0;
	return 1;
}
}
__setup("otg_mode=", eukrea_cpuimx51sd_otg_mode);
__setup("otg_mode=", eukrea_cpuimx51sd_otg_mode);


+4 −4
Original line number Original line Diff line number Diff line
@@ -109,18 +109,18 @@ static const struct fsl_usb2_platform_data otg_device_pdata __initconst = {
	.workaround     = FLS_USB2_WORKAROUND_ENGCM09152,
	.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)
static int __init eukrea_cpuimx25_otg_mode(char *options)
{
{
	if (!strcmp(options, "host"))
	if (!strcmp(options, "host"))
		otg_mode_host = 1;
		otg_mode_host = true;
	else if (!strcmp(options, "device"))
	else if (!strcmp(options, "device"))
		otg_mode_host = 0;
		otg_mode_host = false;
	else
	else
		pr_info("otg_mode neither \"host\" nor \"device\". "
		pr_info("otg_mode neither \"host\" nor \"device\". "
			"Defaulting to device\n");
			"Defaulting to device\n");
	return 0;
	return 1;
}
}
__setup("otg_mode=", eukrea_cpuimx25_otg_mode);
__setup("otg_mode=", eukrea_cpuimx25_otg_mode);


+4 −4
Original line number Original line Diff line number Diff line
@@ -241,18 +241,18 @@ static const struct fsl_usb2_platform_data otg_device_pdata __initconst = {
	.phy_mode       = FSL_USB2_PHY_ULPI,
	.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)
static int __init mx27_3ds_otg_mode(char *options)
{
{
	if (!strcmp(options, "host"))
	if (!strcmp(options, "host"))
		otg_mode_host = 1;
		otg_mode_host = true;
	else if (!strcmp(options, "device"))
	else if (!strcmp(options, "device"))
		otg_mode_host = 0;
		otg_mode_host = false;
	else
	else
		pr_info("otg_mode neither \"host\" nor \"device\". "
		pr_info("otg_mode neither \"host\" nor \"device\". "
			"Defaulting to device\n");
			"Defaulting to device\n");
	return 0;
	return 1;
}
}
__setup("otg_mode=", mx27_3ds_otg_mode);
__setup("otg_mode=", mx27_3ds_otg_mode);


Loading