Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755176AbbBFGzt (ORCPT ); Fri, 6 Feb 2015 01:55:49 -0500 Received: from mail-bn1bon0054.outbound.protection.outlook.com ([157.56.111.54]:4656 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751386AbbBFGzr (ORCPT ); Fri, 6 Feb 2015 01:55:47 -0500 From: "Wu, Aaron" To: Marc Kleine-Budde , "wg@grandegger.com" , "linux-can@vger.kernel.org" , "linux-kernel@vger.kernel.org" , linux-devel Subject: RE: [PATCH V5 2/3] bfin_can: rewrite the driver into common style with MMU Thread-Topic: [PATCH V5 2/3] bfin_can: rewrite the driver into common style with MMU Thread-Index: AQHQQTHOWTMJoCl2BkmxRyeoVw3Ct5ziOL2AgAD2TnA= Date: Fri, 6 Feb 2015 06:54:52 +0000 Message-ID: <649EF91064D35D40B9C93A225BF4167461310F9D@NWD2MBX7.ad.analog.com> References: <1423133067-17289-1-git-send-email-Aaron.wu@analog.com> <1423133067-17289-2-git-send-email-Aaron.wu@analog.com> <54D34E7B.9060001@pengutronix.de> In-Reply-To: <54D34E7B.9060001@pengutronix.de> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.99.26.97] Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 X-EOPAttributedMessage: 0 Authentication-Results: spf=pass (sender IP is 137.71.25.57) smtp.mailfrom=Aaron.Wu@analog.com; vger.kernel.org; dkim=none (message not signed) header.d=none; X-Forefront-Antispam-Report: CIP:137.71.25.57;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(438002)(479174004)(377454003)(51704005)(13464003)(24454002)(16796002)(19580395003)(107886001)(47776003)(6806004)(19580405001)(55846006)(16601075003)(50466002)(50986999)(2900100001)(46102003)(62966003)(86362001)(33656002)(23676002)(106116001)(92566002)(15975445007)(2950100001)(2201001)(102836002)(106466001)(76176999)(87936001)(2501002)(77156002)(54356999)(2656002);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR0301MB0634;H:nwd2mta2.analog.com;FPR:;SPF:Pass;MLV:sfv;LANG:en; X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:CY1PR0301MB0634; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004);SRVR:CY1PR0301MB0634; X-Forefront-PRVS: 047999FF16 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:;SRVR:CY1PR0301MB0634; X-OriginatorOrg: analog.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Feb 2015 06:55:44.0027 (UTC) X-MS-Exchange-CrossTenant-Id: eaa689b4-8f87-40e0-9c6f-7228de4d754a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=eaa689b4-8f87-40e0-9c6f-7228de4d754a;Ip=[137.71.25.57] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0301MB0634 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by nfs id t166tsc7029886 Content-Length: 3003 Lines: 80 Hi Marc, Thanks for your quick review and comments, I've made 3 changes accordingly in V6. Patches have passed function verification on blackfin board and scripts/checkpach.pl with 0 error/warning. Best regards, Aaron > -----Original Message----- > From: Marc Kleine-Budde [mailto:mkl@pengutronix.de] > Sent: 2015年2月5日 19:06 > To: Wu, Aaron; wg@grandegger.com; linux-can@vger.kernel.org; linux- > kernel@vger.kernel.org; linux-devel > Subject: Re: [PATCH V5 2/3] bfin_can: rewrite the driver into common style with > MMU > > On 02/05/2015 11:44 AM, Aaron Wu wrote: > > Rewrite the blackfin CAN driver into more common style in three ways: > > part 1/3: rewrite blackfin style of read/write into common > > readw/writew part 2/3: introduce ioremap to be compitable with MMU > > enabled arch part 3/3: merge the header file from the blackfin arch > > dependent location to driver code directly, note the original copy of > > more completed bfin_can.h in arch depentdent location is reserved for > > reg test purpose > > > > V5 changes: merge contents of header file into drivere code in patch > > 3/3 > > V4 changes: remove unused variable in patch 2/3 > > V3 changes: remove redundant cast in patch 2/3 > > V2 changes: split patch into two parts > > V1 changes: rewrite code into common style > > > > Signed-off-by: Aaron Wu > > --- > > drivers/net/can/bfin_can.c | 22 ++++++++-------------- > > 1 file changed, 8 insertions(+), 14 deletions(-) > > > > diff --git a/drivers/net/can/bfin_can.c b/drivers/net/can/bfin_can.c > > index 0a5eff4..0209c14 100644 > > --- a/drivers/net/can/bfin_can.c > > +++ b/drivers/net/can/bfin_can.c > > @@ -551,16 +551,10 @@ static int bfin_can_probe(struct platform_device > *pdev) > > goto exit; > > } > > > > - if (!request_mem_region(res_mem->start, resource_size(res_mem), > > - dev_name(&pdev->dev))) { > > - err = -EBUSY; > > - goto exit; > > - } > > - > > /* request peripheral pins */ > > err = peripheral_request_list(pdata, dev_name(&pdev->dev)); > > if (err) > > - goto exit_mem_release; > > + goto exit; > > > > dev = alloc_bfin_candev(); > > if (!dev) { > > @@ -569,7 +563,13 @@ static int bfin_can_probe(struct platform_device > *pdev) > > } > > > > priv = netdev_priv(dev); > > - priv->membase = (void __iomem *)res_mem->start; > > + > > + priv->membase = devm_ioremap_resource(&pdev->dev, res_mem); > > + if (IS_ERR(priv->membase)) { > > + dev_err(&pdev->dev, "Cannot map IO\n"); > > devm_ioremap_resource() already prints an error message. > > Marc > -- > Pengutronix e.K. | Marc Kleine-Budde | > Industrial Linux Solutions | Phone: +49-231-2826-924 | > Vertretung West/Dortmund | Fax: +49-5121-206917-5555 | > Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de | ????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?