From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752401AbbFZRMU (ORCPT ); Fri, 26 Jun 2015 13:12:20 -0400 Received: from mail-bn1on0134.outbound.protection.outlook.com ([157.56.110.134]:51766 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751898AbbFZRMI convert rfc822-to-8bit (ORCPT ); Fri, 26 Jun 2015 13:12:08 -0400 From: Badola Nikhil To: "gregkh@linuxfoundation.org" , "stern@rowland.harvard.edu" CC: "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH 1/3][v2] drivers:usb:fsl: Replace macros with enumerated type Thread-Topic: [PATCH 1/3][v2] drivers:usb:fsl: Replace macros with enumerated type Thread-Index: AQHQp1Rp7BBsR9qRs0ivijFWAwHxKJ23SIxg Date: Fri, 26 Jun 2015 17:12:04 +0000 Message-ID: References: <1434363397-19473-1-git-send-email-nikhil.badola@freescale.com> In-Reply-To: <1434363397-19473-1-git-send-email-nikhil.badola@freescale.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: linuxfoundation.org; dkim=none (message not signed) header.d=none; x-originating-ip: [203.76.188.227] x-microsoft-exchange-diagnostics: 1;SN1PR0301MB1629;5:HHZctlucpBGWZELMYdY3mpTT1m55kVGwo3ecdDJdWoh2kpKpF+o+UpNeHKccuRLp8pNv9NfevzCklCykilTjIUhl5XTyMxWUlkA5S/YgwkmFgpLYac8EST4EPB6trHsyRLCQLMn4kKLWr1RHoEkMyg==;24:Be/vClx6YqfioEo1jM6Da24wQMDSj+7WKwvxaDkZiSGr3wLDDBiuan74ISGsBx+iDs7VpFeE18wtYAl4yUiEfNL5u/6qAtyKfhY5HW5Z+NU=;20:ZQ8Ziiywk1Z8n8B97vCRC1N6qdSpnfdNU2iAI3sY58lm+iam3jm+dJg3V7+xVWLrQo84V1JW2n51TOL5XY8riA== x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SN1PR0301MB1629; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(5005006)(3002001);SRVR:SN1PR0301MB1629;BCL:0;PCL:0;RULEID:;SRVR:SN1PR0301MB1629; x-forefront-prvs: 0619D53754 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(51704005)(377454003)(164054003)(13464003)(50986999)(76176999)(54356999)(5003600100002)(92566002)(2501003)(5001770100001)(33656002)(99286002)(575784001)(2171001)(2656002)(87936001)(19580395003)(19580405001)(106116001)(46102003)(5002640100001)(5001960100002)(74316001)(2900100001)(2950100001)(189998001)(77096005)(40100003)(102836002)(122556002)(76576001)(86362001)(62966003)(77156002);DIR:OUT;SFP:1102;SCL:1;SRVR:SN1PR0301MB1629;H:SN1PR0301MB1629.namprd03.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Jun 2015 17:12:04.0437 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR0301MB1629 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > -----Original Message----- > From: Nikhil Badola [mailto:nikhil.badola@freescale.com] > Sent: Monday, June 15, 2015 3:47 PM > To: linux-usb@vger.kernel.org; linux-kernel@vger.kernel.org > Cc: gregkh@linuxfoundation.org; stern@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(&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 10000 /* 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_ver controller_ver; > enum fsl_usb2_operating_modes operating_mode; > enum fsl_usb2_phy_modes phy_mode; > unsigned int port_enables; > -- Hi Greg/Alan, Could you please provide comments for this patch and the subsequent patches in this patch set, if any. Thanks, Nikhil