Path: csiph.com!news.freedyn.net!aioe.org!gothmog.csi.it!bofh.it!news.nic.it!robomod From: Alison Schofield Newsgroups: linux.kernel Subject: [PATCH 5/9] iio: accel: mma7455: use regmap to retrieve struct device Date: Wed, 06 Apr 2016 07:20:02 +0200 Message-ID: References: X-Original-To: jic23@kernel.org Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=qi+A9b7KZmK24frGQYWkoVa8UmlEr3YlW5YPSrcVaPA=; b=MTIuQppdRKtdPqd8As/xuYpTFk2osWzUtO8YGrrvTghkLKvWzQ/2R7CLaVgbPaF6yC cJsaHz3GFGqGMRHVxrJdlD/NxwwJHfO91QSL5+c/WPMxAQTdcOuYOiQ+E2vGZCpiE5XH gl3V9TEtioAlPbOxTxhmcMF8xyGnLSs1q5k26/wzk6ptf1SdAd6HaHAgiqAhZ/vLzXEY M61CwzYQI9Hm5Yb/NYd3rcKrd+TLE0OVE7w3j2h02pJiPVeo4jJ+jogzvSzA5g9+Y4W7 m+eiPNiVN9vpIUX4RCuYVgLgv9YWXgIGOUroOBUzQySk/Y5YVNnlMfeQPL7E0BqWS5LL WMGg== X-Google-Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=qi+A9b7KZmK24frGQYWkoVa8UmlEr3YlW5YPSrcVaPA=; b=QNFyNNUuiH5iGY9W9QjY+e8Jer+g5rCxup1knf9LnEcqw+tiTV8m2aYYfFgimXiQZU 0TGmJ4A1Ce+Bkit7MN0yP9e03H0MiN4OKGWu784Cg606iRqW7fntf4wJTuJ015u8sKX4 OkYZvCKI/dt3En79t7s0OjIOPHeTN4hi3AEIj8WI3CYDMtE8VZmV0+l9KJrsHYsngbAZ QobwZOiqc+5XGcCwjerxXvsAOUNt5gJFIoYwFoLwPPa7D+l825/H3KBt1j3OPzYutdne eoNUnNz+PRZnzPuR/f+RTqa8ag7h5VfkTto/eJiznV+mcH9nMaRyTREasNlm8U5EvOUd J5zw== X-Gm-Message-State: AD7BkJIXkPA+3LCEJhrQ/ge3sKcpAMyEXn9jpUL1SrMN+mC9J4/+9hY4YAefq957XeoFnA== X-Received: by 10.66.55.70 with SMTP id q6mr66518001pap.126.1459919925618; Tue, 05 Apr 2016 22:18:45 -0700 (PDT) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) Sender: robomod@news.nic.it List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Approved: robomod@news.nic.it Lines: 46 Organization: linux.* mail to news gateway X-Original-Cc: knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, kgene@kernel.org, k.kozlowski@samsung.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org X-Original-Date: Tue, 5 Apr 2016 22:18:44 -0700 X-Original-Message-ID: X-Original-References: X-Original-Sender: linux-kernel-owner@vger.kernel.org Xref: csiph.com linux.kernel:1372191 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); unsigned int reg; int tries = 3; int ret; @@ -75,7 +75,7 @@ static int mma7455_drdy(struct mma7455_data *mma7455) msleep(20); } - dev_warn(mma7455->dev, "data not ready\n"); + dev_warn(dev, "data not ready\n"); return -EIO; } @@ -260,7 +260,6 @@ int mma7455_core_probe(struct device *dev, struct regmap *regmap, dev_set_drvdata(dev, indio_dev); mma7455 = iio_priv(indio_dev); mma7455->regmap = regmap; - mma7455->dev = dev; indio_dev->info = &mma7455_info; indio_dev->name = name; -- 2.1.4