From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755662Ab2BACLc (ORCPT ); Tue, 31 Jan 2012 21:11:32 -0500 Received: from mail-yx0-f174.google.com ([209.85.213.174]:37292 "EHLO mail-yx0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752850Ab2BACLb convert rfc822-to-8bit (ORCPT ); Tue, 31 Jan 2012 21:11:31 -0500 MIME-Version: 1.0 In-Reply-To: <20120131211554.GA28105@pengutronix.de> References: <1328004002-24646-1-git-send-email-Barry.Song@csr.com> <1328004002-24646-2-git-send-email-Barry.Song@csr.com> <20120131101734.GE2471@pengutronix.de> <20120131113358.GM2471@pengutronix.de> <20120131203455.GG22611@ponder.secretlab.ca> <20120131211554.GA28105@pengutronix.de> From: Barry Song <21cnbao@gmail.com> Date: Wed, 1 Feb 2012 10:11:10 +0800 Message-ID: Subject: Re: [PATCH 1/3] platform: add common resource requesting and mapping helper To: Wolfram Sang Cc: Grant Likely , Barry Song , Linus Walleij , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, workgroup.linux@csr.com, Erik Gilling , linux-mtd@lists.infradead.org, Barry Song , David Woodhouse , Atsushi Nemoto Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org hi Wolfram, 2012/2/1 Wolfram Sang : > >> > I am not sure using 'platform_devm_request_and_ioremap' and later using >> > plain 'devm_*' functions (without platform_-prefix) is less confusing. >> > The alternative would be to check which helper functions also use >> > 'struct resource' and if they do checks on that. If all do that, you >> > would have the simple rule, that you only need to check yourself if you >> > access it yourself. >> >> The reason I suggested the wrapper is that then the driver code doesn't need >> to fart around with the res pointer at all.  It reduces boilerplate in platform >> drivers which I think is a good thing. > > I do understand your motivation and fully agree with what you are aiming for > (that's exactly why I implemented devm_request_and_ioremap()). > > This patch is a micro-optimization, though, and won't cut it IMHO. I still have > issues with only one platform_devm_* and all the rest being devm_* (without > platform_). Things might look better, if we'd for example also have > platform_devm_request_irq() or something similar. That might be an approach > where we can play around with and see what is left to do. Or, if other > approaches might be more elegant. > > To discuss that, try things, etc, I'd simply like to have a bit more time. If > we are accepting the first iteration right away, and people let run their > coccinelle-scripts based on that, it might get annoying to change that a second > time, I'd think. > i think it makes sense for us to have platform_devm_request_irq() and similar things. i'll take care. PS: as the man maintaining embedded systems of the i2c subsystem, would you comment the CSR i2c driver which has been there waiting for a long time? http://www.spinics.net/lists/linux-i2c/msg07081.html > Regards, > >   Wolfram > > -- > Pengutronix e.K.                           | Wolfram Sang                | > Industrial Linux Solutions                 | http://www.pengutronix.de/  | Thanks barry