Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753370AbcDJNvl (ORCPT ); Sun, 10 Apr 2016 09:51:41 -0400 Received: from saturn.retrosnub.co.uk ([178.18.118.26]:43968 "EHLO saturn.retrosnub.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753060AbcDJNvj (ORCPT ); Sun, 10 Apr 2016 09:51:39 -0400 Subject: Re: [PATCH 5/9] iio: accel: mma7455: use regmap to retrieve struct device To: Joachim Eastwood , Alison Schofield References: Cc: Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Kukjin Kim , =?UTF-8?Q?Krzysztof_Koz=c5=82owski?= , linux-iio@vger.kernel.org, "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , linux-samsung-soc@vger.kernel.org From: Jonathan Cameron Message-ID: <570A5A66.4020901@kernel.org> Date: Sun, 10 Apr 2016 14:51:34 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1608 Lines: 51 On 06/04/16 08:35, Joachim Eastwood wrote: > Hi Alison, > > On 6 April 2016 at 07:18, Alison Schofield wrote: >> Driver includes struct regmap and struct device in its global data. >> Remove the struct device and use regmap API to retrieve device info. >> >> Patch created using Coccinelle plus manual edits. >> >> Signed-off-by: Alison Schofield >> --- >> drivers/iio/accel/mma7455_core.c | 5 ++--- >> 1 file changed, 2 insertions(+), 3 deletions(-) >> >> diff --git a/drivers/iio/accel/mma7455_core.c b/drivers/iio/accel/mma7455_core.c >> index c633cc2..c902f54 100644 >> --- a/drivers/iio/accel/mma7455_core.c >> +++ b/drivers/iio/accel/mma7455_core.c >> @@ -55,11 +55,11 @@ >> >> struct mma7455_data { >> struct regmap *regmap; >> - struct device *dev; >> }; >> >> static int mma7455_drdy(struct mma7455_data *mma7455) >> { >> + struct device *dev = regmap_get_device(mma7455->regmap); > > ah, nice! > > Acked-by: Joachim Eastwood Applied to the togreg branch of iio.git - initially pushed out as testing for the autobuilders to play with it. This one is a fairly standard case and can be easily chased through to see that the device pointer is the same one either way. I'm going to let the rest sit a little longer to see if we get more feedback on them Jonathan > > > regards, > Joachim Eastwood > -- > To unsubscribe from this list: send the line "unsubscribe linux-iio" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html >