From patchwork Wed Apr 6 05:18:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alison Schofield X-Patchwork-Id: 8758291 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0CF90C0553 for ; Wed, 6 Apr 2016 05:18:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2A3A7200BE for ; Wed, 6 Apr 2016 05:18:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 27597201CE for ; Wed, 6 Apr 2016 05:18:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761051AbcDFFSs (ORCPT ); Wed, 6 Apr 2016 01:18:48 -0400 Received: from mail-pa0-f65.google.com ([209.85.220.65]:33845 "EHLO mail-pa0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761025AbcDFFSq (ORCPT ); Wed, 6 Apr 2016 01:18:46 -0400 Received: by mail-pa0-f65.google.com with SMTP id hb4so3080617pac.1; Tue, 05 Apr 2016 22:18:46 -0700 (PDT) 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) Received: from d830 (or-67-232-74-92.dhcp.embarqhsd.net. [67.232.74.92]) by smtp.gmail.com with ESMTPSA id 9sm1356341pft.44.2016.04.05.22.18.45 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 05 Apr 2016 22:18:45 -0700 (PDT) Date: Tue, 5 Apr 2016 22:18:44 -0700 From: Alison Schofield To: jic23@kernel.org 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 Subject: [PATCH 5/9] iio: accel: mma7455: use regmap to retrieve struct device Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Acked-by: Joachim Eastwood --- 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;