Re: [PATCH 1/3][v2] drivers:usb:fsl: Replace macros with enumerated type

2015-06-26 Thread gre...@linuxfoundation.org
On Fri, Jun 26, 2015 at 05:12:04PM +, Badola Nikhil wrote:
> > -Original Message-
> > From: Nikhil Badola [mailto:nikhil.bad...@freescale.com]
> > Sent: Monday, June 15, 2015 3:47 PM



> Could you please provide comments for this patch and the subsequent
> patches in this patch set, if any.

It's the middle of the merge window right now, there's nothing I can do
with this until after it is over.  Please wait until then to expect a
response, and even then, give me a week or so to dig out from under the
pending-patch load.

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH 1/3][v2] drivers:usb:fsl: Replace macros with enumerated type

2015-06-26 Thread Alan Stern
On Fri, 26 Jun 2015, Badola Nikhil wrote:

> Hi Greg/Alan,
> 
> Could you please provide comments for this patch and the subsequent
> patches in this patch set, if any.

You shouldn't ask Greg and me; you should ask the Freescale maintainer.  
He is the person who has to approve your patches.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH 1/3][v2] drivers:usb:fsl: Replace macros with enumerated type

2015-06-26 Thread Badola Nikhil
> -Original Message-
> From: Nikhil Badola [mailto:nikhil.bad...@freescale.com]
> Sent: Monday, June 15, 2015 3:47 PM
> To: linux-...@vger.kernel.org; linux-kernel@vger.kernel.org
> Cc: gre...@linuxfoundation.org; st...@rowland.harvard.edu; Badola Nikhil-
> B46172
> Subject: [PATCH 1/3][v2] drivers:usb:fsl: Replace macros with enumerated
> type
> 
> Replace macros with enumerated type to represent usb ip controller version
> 
> Signed-off-by: Nikhil Badola 
> ---
> Changes for v2 :
>   - Assigned value to each enumerator
>   - Changed return type of function that returns
> controller version
>   - Introduced FSL_USB_VER_NONE for invalid controller version
> 
>  drivers/usb/host/fsl-mph-dr-of.c |  8 
>  include/linux/fsl_devices.h  | 16 ++--
>  2 files changed, 14 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/usb/host/fsl-mph-dr-of.c b/drivers/usb/host/fsl-mph-dr-
> of.c
> index 5e0d600..2195956 100644
> --- a/drivers/usb/host/fsl-mph-dr-of.c
> +++ b/drivers/usb/host/fsl-mph-dr-of.c
> @@ -119,9 +119,9 @@ error:
> 
>  static const struct of_device_id fsl_usb2_mph_dr_of_match[];
> 
> -static int usb_get_ver_info(struct device_node *np)
> +static enum fsl_usb2_controller_ver usb_get_ver_info(struct device_node
> +*np)
>  {
> - int ver = -1;
> + enum fsl_usb2_controller_ver ver = FSL_USB_VER_NONE;
> 
>   /*
>* returns 1 for usb controller version 1.6 @@ -142,7 +142,7 @@ static
> int usb_get_ver_info(struct device_node *np)
>   else /* for previous controller versions */
>   ver = FSL_USB_VER_OLD;
> 
> - if (ver > -1)
> + if (ver > FSL_USB_VER_NONE)
>   return ver;
>   }
> 
> @@ -215,7 +215,7 @@ static int fsl_usb2_mph_dr_of_probe(struct
> platform_device *ofdev)
>   pdata->controller_ver = usb_get_ver_info(np);
> 
>   if (pdata->have_sysif_regs) {
> - if (pdata->controller_ver < 0) {
> + if (pdata->controller_ver == FSL_USB_VER_NONE) {
>   dev_warn(>dev, "Could not get controller
> version\n");
>   return -ENODEV;
>   }
> diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h index
> 2a2f56b..0d4855cd 100644
> --- a/include/linux/fsl_devices.h
> +++ b/include/linux/fsl_devices.h
> @@ -20,11 +20,6 @@
>  #define FSL_UTMI_PHY_DLY 10  /*As per P1010RM, delay for UTMI
>   PHY CLK to become stable - 10ms*/
>  #define FSL_USB_PHY_CLK_TIMEOUT  1   /* uSec */
> -#define FSL_USB_VER_OLD  0
> -#define FSL_USB_VER_1_6  1
> -#define FSL_USB_VER_2_2  2
> -#define FSL_USB_VER_2_4  3
> -#define FSL_USB_VER_2_5  4
> 
>  #include 
> 
> @@ -52,6 +47,15 @@
>   *
>   */
> 
> +enum fsl_usb2_controller_ver {
> + FSL_USB_VER_NONE = -1,
> + FSL_USB_VER_OLD = 0,
> + FSL_USB_VER_1_6 = 1,
> + FSL_USB_VER_2_2 = 2,
> + FSL_USB_VER_2_4 = 3,
> + FSL_USB_VER_2_5 = 4,
> +};
> +
>  enum fsl_usb2_operating_modes {
>   FSL_USB2_MPH_HOST,
>   FSL_USB2_DR_HOST,
> @@ -72,7 +76,7 @@ struct platform_device;
> 
>  struct fsl_usb2_platform_data {
>   /* board specific information */
> - int controller_ver;
> + enum fsl_usb2_controller_vercontroller_ver;
>   enum fsl_usb2_operating_modes   operating_mode;
>   enum fsl_usb2_phy_modes phy_mode;
>   unsigned intport_enables;
> --

Hi Greg/Alan,

Could you please provide comments for this patch and the subsequent
patches in this patch set, if any.

Thanks,
Nikhil 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH 1/3][v2] drivers:usb:fsl: Replace macros with enumerated type

2015-06-26 Thread Alan Stern
On Fri, 26 Jun 2015, Badola Nikhil wrote:

 Hi Greg/Alan,
 
 Could you please provide comments for this patch and the subsequent
 patches in this patch set, if any.

You shouldn't ask Greg and me; you should ask the Freescale maintainer.  
He is the person who has to approve your patches.

Alan Stern

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH 1/3][v2] drivers:usb:fsl: Replace macros with enumerated type

2015-06-26 Thread Badola Nikhil
 -Original Message-
 From: Nikhil Badola [mailto:nikhil.bad...@freescale.com]
 Sent: Monday, June 15, 2015 3:47 PM
 To: linux-...@vger.kernel.org; linux-kernel@vger.kernel.org
 Cc: gre...@linuxfoundation.org; st...@rowland.harvard.edu; Badola Nikhil-
 B46172
 Subject: [PATCH 1/3][v2] drivers:usb:fsl: Replace macros with enumerated
 type
 
 Replace macros with enumerated type to represent usb ip controller version
 
 Signed-off-by: Nikhil Badola nikhil.bad...@freescale.com
 ---
 Changes for v2 :
   - Assigned value to each enumerator
   - Changed return type of function that returns
 controller version
   - Introduced FSL_USB_VER_NONE for invalid controller version
 
  drivers/usb/host/fsl-mph-dr-of.c |  8 
  include/linux/fsl_devices.h  | 16 ++--
  2 files changed, 14 insertions(+), 10 deletions(-)
 
 diff --git a/drivers/usb/host/fsl-mph-dr-of.c b/drivers/usb/host/fsl-mph-dr-
 of.c
 index 5e0d600..2195956 100644
 --- a/drivers/usb/host/fsl-mph-dr-of.c
 +++ b/drivers/usb/host/fsl-mph-dr-of.c
 @@ -119,9 +119,9 @@ error:
 
  static const struct of_device_id fsl_usb2_mph_dr_of_match[];
 
 -static int usb_get_ver_info(struct device_node *np)
 +static enum fsl_usb2_controller_ver usb_get_ver_info(struct device_node
 +*np)
  {
 - int ver = -1;
 + enum fsl_usb2_controller_ver ver = FSL_USB_VER_NONE;
 
   /*
* returns 1 for usb controller version 1.6 @@ -142,7 +142,7 @@ static
 int usb_get_ver_info(struct device_node *np)
   else /* for previous controller versions */
   ver = FSL_USB_VER_OLD;
 
 - if (ver  -1)
 + if (ver  FSL_USB_VER_NONE)
   return ver;
   }
 
 @@ -215,7 +215,7 @@ static int fsl_usb2_mph_dr_of_probe(struct
 platform_device *ofdev)
   pdata-controller_ver = usb_get_ver_info(np);
 
   if (pdata-have_sysif_regs) {
 - if (pdata-controller_ver  0) {
 + if (pdata-controller_ver == FSL_USB_VER_NONE) {
   dev_warn(ofdev-dev, Could not get controller
 version\n);
   return -ENODEV;
   }
 diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h index
 2a2f56b..0d4855cd 100644
 --- a/include/linux/fsl_devices.h
 +++ b/include/linux/fsl_devices.h
 @@ -20,11 +20,6 @@
  #define FSL_UTMI_PHY_DLY 10  /*As per P1010RM, delay for UTMI
   PHY CLK to become stable - 10ms*/
  #define FSL_USB_PHY_CLK_TIMEOUT  1   /* uSec */
 -#define FSL_USB_VER_OLD  0
 -#define FSL_USB_VER_1_6  1
 -#define FSL_USB_VER_2_2  2
 -#define FSL_USB_VER_2_4  3
 -#define FSL_USB_VER_2_5  4
 
  #include linux/types.h
 
 @@ -52,6 +47,15 @@
   *
   */
 
 +enum fsl_usb2_controller_ver {
 + FSL_USB_VER_NONE = -1,
 + FSL_USB_VER_OLD = 0,
 + FSL_USB_VER_1_6 = 1,
 + FSL_USB_VER_2_2 = 2,
 + FSL_USB_VER_2_4 = 3,
 + FSL_USB_VER_2_5 = 4,
 +};
 +
  enum fsl_usb2_operating_modes {
   FSL_USB2_MPH_HOST,
   FSL_USB2_DR_HOST,
 @@ -72,7 +76,7 @@ struct platform_device;
 
  struct fsl_usb2_platform_data {
   /* board specific information */
 - int controller_ver;
 + enum fsl_usb2_controller_vercontroller_ver;
   enum fsl_usb2_operating_modes   operating_mode;
   enum fsl_usb2_phy_modes phy_mode;
   unsigned intport_enables;
 --

Hi Greg/Alan,

Could you please provide comments for this patch and the subsequent
patches in this patch set, if any.

Thanks,
Nikhil 

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/3][v2] drivers:usb:fsl: Replace macros with enumerated type

2015-06-26 Thread gre...@linuxfoundation.org
On Fri, Jun 26, 2015 at 05:12:04PM +, Badola Nikhil wrote:
  -Original Message-
  From: Nikhil Badola [mailto:nikhil.bad...@freescale.com]
  Sent: Monday, June 15, 2015 3:47 PM

snip

 Could you please provide comments for this patch and the subsequent
 patches in this patch set, if any.

It's the middle of the merge window right now, there's nothing I can do
with this until after it is over.  Please wait until then to expect a
response, and even then, give me a week or so to dig out from under the
pending-patch load.

thanks,

greg k-h
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/3][v2] drivers:usb:fsl: Replace macros with enumerated type

2015-06-15 Thread Nikhil Badola
Replace macros with enumerated type to represent usb ip
controller version

Signed-off-by: Nikhil Badola 
---
Changes for v2 :
- Assigned value to each enumerator
- Changed return type of function that returns
  controller version
- Introduced FSL_USB_VER_NONE for invalid controller version

 drivers/usb/host/fsl-mph-dr-of.c |  8 
 include/linux/fsl_devices.h  | 16 ++--
 2 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/drivers/usb/host/fsl-mph-dr-of.c b/drivers/usb/host/fsl-mph-dr-of.c
index 5e0d600..2195956 100644
--- a/drivers/usb/host/fsl-mph-dr-of.c
+++ b/drivers/usb/host/fsl-mph-dr-of.c
@@ -119,9 +119,9 @@ error:
 
 static const struct of_device_id fsl_usb2_mph_dr_of_match[];
 
-static int usb_get_ver_info(struct device_node *np)
+static enum fsl_usb2_controller_ver usb_get_ver_info(struct device_node *np)
 {
-   int ver = -1;
+   enum fsl_usb2_controller_ver ver = FSL_USB_VER_NONE;
 
/*
 * returns 1 for usb controller version 1.6
@@ -142,7 +142,7 @@ static int usb_get_ver_info(struct device_node *np)
else /* for previous controller versions */
ver = FSL_USB_VER_OLD;
 
-   if (ver > -1)
+   if (ver > FSL_USB_VER_NONE)
return ver;
}
 
@@ -215,7 +215,7 @@ static int fsl_usb2_mph_dr_of_probe(struct platform_device 
*ofdev)
pdata->controller_ver = usb_get_ver_info(np);
 
if (pdata->have_sysif_regs) {
-   if (pdata->controller_ver < 0) {
+   if (pdata->controller_ver == FSL_USB_VER_NONE) {
dev_warn(>dev, "Could not get controller 
version\n");
return -ENODEV;
}
diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h
index 2a2f56b..0d4855cd 100644
--- a/include/linux/fsl_devices.h
+++ b/include/linux/fsl_devices.h
@@ -20,11 +20,6 @@
 #define FSL_UTMI_PHY_DLY   10  /*As per P1010RM, delay for UTMI
PHY CLK to become stable - 10ms*/
 #define FSL_USB_PHY_CLK_TIMEOUT1   /* uSec */
-#define FSL_USB_VER_OLD0
-#define FSL_USB_VER_1_61
-#define FSL_USB_VER_2_22
-#define FSL_USB_VER_2_43
-#define FSL_USB_VER_2_54
 
 #include 
 
@@ -52,6 +47,15 @@
  *
  */
 
+enum fsl_usb2_controller_ver {
+   FSL_USB_VER_NONE = -1,
+   FSL_USB_VER_OLD = 0,
+   FSL_USB_VER_1_6 = 1,
+   FSL_USB_VER_2_2 = 2,
+   FSL_USB_VER_2_4 = 3,
+   FSL_USB_VER_2_5 = 4,
+};
+
 enum fsl_usb2_operating_modes {
FSL_USB2_MPH_HOST,
FSL_USB2_DR_HOST,
@@ -72,7 +76,7 @@ struct platform_device;
 
 struct fsl_usb2_platform_data {
/* board specific information */
-   int controller_ver;
+   enum fsl_usb2_controller_vercontroller_ver;
enum fsl_usb2_operating_modes   operating_mode;
enum fsl_usb2_phy_modes phy_mode;
unsigned intport_enables;
-- 
1.7.11.7


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/3][v2] drivers:usb:fsl: Replace macros with enumerated type

2015-06-15 Thread Nikhil Badola
Replace macros with enumerated type to represent usb ip
controller version

Signed-off-by: Nikhil Badola nikhil.bad...@freescale.com
---
Changes for v2 :
- Assigned value to each enumerator
- Changed return type of function that returns
  controller version
- Introduced FSL_USB_VER_NONE for invalid controller version

 drivers/usb/host/fsl-mph-dr-of.c |  8 
 include/linux/fsl_devices.h  | 16 ++--
 2 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/drivers/usb/host/fsl-mph-dr-of.c b/drivers/usb/host/fsl-mph-dr-of.c
index 5e0d600..2195956 100644
--- a/drivers/usb/host/fsl-mph-dr-of.c
+++ b/drivers/usb/host/fsl-mph-dr-of.c
@@ -119,9 +119,9 @@ error:
 
 static const struct of_device_id fsl_usb2_mph_dr_of_match[];
 
-static int usb_get_ver_info(struct device_node *np)
+static enum fsl_usb2_controller_ver usb_get_ver_info(struct device_node *np)
 {
-   int ver = -1;
+   enum fsl_usb2_controller_ver ver = FSL_USB_VER_NONE;
 
/*
 * returns 1 for usb controller version 1.6
@@ -142,7 +142,7 @@ static int usb_get_ver_info(struct device_node *np)
else /* for previous controller versions */
ver = FSL_USB_VER_OLD;
 
-   if (ver  -1)
+   if (ver  FSL_USB_VER_NONE)
return ver;
}
 
@@ -215,7 +215,7 @@ static int fsl_usb2_mph_dr_of_probe(struct platform_device 
*ofdev)
pdata-controller_ver = usb_get_ver_info(np);
 
if (pdata-have_sysif_regs) {
-   if (pdata-controller_ver  0) {
+   if (pdata-controller_ver == FSL_USB_VER_NONE) {
dev_warn(ofdev-dev, Could not get controller 
version\n);
return -ENODEV;
}
diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h
index 2a2f56b..0d4855cd 100644
--- a/include/linux/fsl_devices.h
+++ b/include/linux/fsl_devices.h
@@ -20,11 +20,6 @@
 #define FSL_UTMI_PHY_DLY   10  /*As per P1010RM, delay for UTMI
PHY CLK to become stable - 10ms*/
 #define FSL_USB_PHY_CLK_TIMEOUT1   /* uSec */
-#define FSL_USB_VER_OLD0
-#define FSL_USB_VER_1_61
-#define FSL_USB_VER_2_22
-#define FSL_USB_VER_2_43
-#define FSL_USB_VER_2_54
 
 #include linux/types.h
 
@@ -52,6 +47,15 @@
  *
  */
 
+enum fsl_usb2_controller_ver {
+   FSL_USB_VER_NONE = -1,
+   FSL_USB_VER_OLD = 0,
+   FSL_USB_VER_1_6 = 1,
+   FSL_USB_VER_2_2 = 2,
+   FSL_USB_VER_2_4 = 3,
+   FSL_USB_VER_2_5 = 4,
+};
+
 enum fsl_usb2_operating_modes {
FSL_USB2_MPH_HOST,
FSL_USB2_DR_HOST,
@@ -72,7 +76,7 @@ struct platform_device;
 
 struct fsl_usb2_platform_data {
/* board specific information */
-   int controller_ver;
+   enum fsl_usb2_controller_vercontroller_ver;
enum fsl_usb2_operating_modes   operating_mode;
enum fsl_usb2_phy_modes phy_mode;
unsigned intport_enables;
-- 
1.7.11.7


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/