From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9642EC55178 for ; Mon, 26 Oct 2020 13:36:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4EE8B2465B for ; Mon, 26 Oct 2020 13:36:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20150623.gappssmtp.com header.i=@bgdev-pl.20150623.gappssmtp.com header.b="ETNQ5C4O" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1780245AbgJZNg0 (ORCPT ); Mon, 26 Oct 2020 09:36:26 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:40389 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1780233AbgJZNgZ (ORCPT ); Mon, 26 Oct 2020 09:36:25 -0400 Received: by mail-wm1-f68.google.com with SMTP id k18so12467174wmj.5 for ; Mon, 26 Oct 2020 06:36:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oc+CRyq0MP1rGPx6qu4fJIiuXgNVzq5WpNvySKjLu6M=; b=ETNQ5C4O4Im+z0OFc2LmdOrgCbdwcTHV3i/sud6MR3r4APa/DibA2O/U7gKfdhQtcD GyAC8xb4Z1kpnIu1iiF7XUI3Brt3EafJsFgfgxnSrRFgXrBAJ/h35VjL/IZBqjBU36V9 7abLJobIJsHmrGESMQ9uBBYvHLfTAaxOU0L4xz+Iv3dR0QI48jjWKBNZv21Rnw3FnzPo BP1hBl+MYk949RWjY9XvWCr5WQM6IqnCuRTXiWPgJPZ4w7s1kozW/FJRw+iWdvYXMvBU mgsiWrgZfJOxqnfRlN96vgoRWjxogl/Ei1RrQe5WSMCzaID4NvAvXfnMMB35tqBNzrSn yE0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oc+CRyq0MP1rGPx6qu4fJIiuXgNVzq5WpNvySKjLu6M=; b=Ba+TgsBsdnqOUhgpnTl0Eh8mTUpgJ4Ai2wivSXGlfz3qecntro3AbCZusY6KTO5Dit YlK0pR9wtl2l7YdfZK4Zg7FUj24UY76xA9axvgst6I/pF8wh919ya/unPv7GvmHRm/xM mmZtS3TO53GCFUEeSCf5i1v7rV1+57Fs2eprCRUc8TiV4jLQ02VKE9pVximKr+XSmQ5A DuWg8hmmPNC4QGiV6QOOf1Xv/VC6rCO0Uw6MDmfc0lRdfVyftSPoufp0aNTIp84cb7Zl AzyJiKcmrWxSnTkmUdpO7952hB/TTrw7QjpJOd74hAVkcyiHIYHyXcukj5FUYkmFtL6j +4kQ== X-Gm-Message-State: AOAM532F0aTmHu7SAloNeIoBwnT5n6BlTPt8gfiNK6Ju1AG1TymIwGsy 28HufbN6ioogK+x/6Gv/pFl0kw== X-Google-Smtp-Source: ABdhPJxRBZnwVrN5mfPlZqgpI52Qd3hNu9GOYY/E9bIWA0MosamJ/tI/ASBpOEiIxMQWYBucoMAVUA== X-Received: by 2002:a1c:2601:: with SMTP id m1mr15236488wmm.12.1603719381363; Mon, 26 Oct 2020 06:36:21 -0700 (PDT) Received: from localhost.localdomain (lfbn-nic-1-190-206.w2-15.abo.wanadoo.fr. [2.15.39.206]) by smtp.gmail.com with ESMTPSA id f7sm23688991wrx.64.2020.10.26.06.36.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Oct 2020 06:36:20 -0700 (PDT) From: Bartosz Golaszewski To: Jonathan Cameron , Lars-Peter Clausen , Peter Meerwald-Stadler , Michal Simek Cc: linux-iio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH 1/5] iio: adc: xilinx: use helper variable for &pdev->dev Date: Mon, 26 Oct 2020 14:36:05 +0100 Message-Id: <20201026133609.24262-2-brgl@bgdev.pl> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201026133609.24262-1-brgl@bgdev.pl> References: <20201026133609.24262-1-brgl@bgdev.pl> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Bartosz Golaszewski It's more elegant to use a helper local variable to store the address of the underlying struct device than to dereference pdev everywhere. Signed-off-by: Bartosz Golaszewski --- drivers/iio/adc/xilinx-xadc-core.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/iio/adc/xilinx-xadc-core.c b/drivers/iio/adc/xilinx-xadc-core.c index f93c34fe5873..8494eb424b33 100644 --- a/drivers/iio/adc/xilinx-xadc-core.c +++ b/drivers/iio/adc/xilinx-xadc-core.c @@ -1186,6 +1186,7 @@ static int xadc_parse_dt(struct iio_dev *indio_dev, struct device_node *np, static int xadc_probe(struct platform_device *pdev) { + struct device *dev = &pdev->dev; const struct of_device_id *id; struct iio_dev *indio_dev; unsigned int bipolar_mask; @@ -1195,10 +1196,10 @@ static int xadc_probe(struct platform_device *pdev) int irq; int i; - if (!pdev->dev.of_node) + if (!dev->of_node) return -ENODEV; - id = of_match_node(xadc_of_match_table, pdev->dev.of_node); + id = of_match_node(xadc_of_match_table, dev->of_node); if (!id) return -EINVAL; @@ -1206,7 +1207,7 @@ static int xadc_probe(struct platform_device *pdev) if (irq <= 0) return -ENXIO; - indio_dev = devm_iio_device_alloc(&pdev->dev, sizeof(*xadc)); + indio_dev = devm_iio_device_alloc(dev, sizeof(*xadc)); if (!indio_dev) return -ENOMEM; @@ -1226,7 +1227,7 @@ static int xadc_probe(struct platform_device *pdev) indio_dev->modes = INDIO_DIRECT_MODE; indio_dev->info = &xadc_info; - ret = xadc_parse_dt(indio_dev, pdev->dev.of_node, &conf0); + ret = xadc_parse_dt(indio_dev, dev->of_node, &conf0); if (ret) return ret; @@ -1250,7 +1251,7 @@ static int xadc_probe(struct platform_device *pdev) } } - xadc->clk = devm_clk_get(&pdev->dev, NULL); + xadc->clk = devm_clk_get(dev, NULL); if (IS_ERR(xadc->clk)) { ret = PTR_ERR(xadc->clk); goto err_free_samplerate_trigger; @@ -1276,7 +1277,7 @@ static int xadc_probe(struct platform_device *pdev) } ret = request_irq(xadc->irq, xadc->ops->interrupt_handler, 0, - dev_name(&pdev->dev), indio_dev); + dev_name(dev), indio_dev); if (ret) goto err_clk_disable_unprepare; -- 2.29.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E234AC4363A for ; Mon, 26 Oct 2020 13:47:59 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 827922242C for ; Mon, 26 Oct 2020 13:47:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="aZqVLLob"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=bgdev-pl.20150623.gappssmtp.com header.i=@bgdev-pl.20150623.gappssmtp.com header.b="ETNQ5C4O" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 827922242C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=DeghFafAITrCP4aXhN1tng6N7rUAuLdNFy5oMXK+jyY=; b=aZqVLLob1YUw31bmXs7+GLJ6J G+4J2pQvzpju8tHGC55Nb9OOD6+WDkw9OgkmXj2ynDMSgYYZIJs1cIiJmSy4TdyFNA4ZtWuSzBNtU McFSsqd0aTm8l30+kOu1pOXcVUh1lAF+x5gJWT49lNY5jhVW2T3f1RyhYqBz/mMU9Jb8T281dTPEJ eP2T3/GBOc7X5JXfur+YxV+EM6BVWnMskWIZRbfXryspjfsKib/2EE1xCu4Jjtgls5/396SUWR8X/ 8v8RniCwCet49qjdeerVx34Pd3jDV6ceG5uJn11wLbFL2z4HM1hMWqZN/GB6ZKdGMh6FXpVzecWQO bpNJzeFqg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kX2p0-0004Ny-Ou; Mon, 26 Oct 2020 13:46:02 +0000 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kX2fi-0008DY-Qx for linux-arm-kernel@lists.infradead.org; Mon, 26 Oct 2020 13:36:29 +0000 Received: by mail-wm1-x342.google.com with SMTP id a72so11681169wme.5 for ; Mon, 26 Oct 2020 06:36:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oc+CRyq0MP1rGPx6qu4fJIiuXgNVzq5WpNvySKjLu6M=; b=ETNQ5C4O4Im+z0OFc2LmdOrgCbdwcTHV3i/sud6MR3r4APa/DibA2O/U7gKfdhQtcD GyAC8xb4Z1kpnIu1iiF7XUI3Brt3EafJsFgfgxnSrRFgXrBAJ/h35VjL/IZBqjBU36V9 7abLJobIJsHmrGESMQ9uBBYvHLfTAaxOU0L4xz+Iv3dR0QI48jjWKBNZv21Rnw3FnzPo BP1hBl+MYk949RWjY9XvWCr5WQM6IqnCuRTXiWPgJPZ4w7s1kozW/FJRw+iWdvYXMvBU mgsiWrgZfJOxqnfRlN96vgoRWjxogl/Ei1RrQe5WSMCzaID4NvAvXfnMMB35tqBNzrSn yE0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oc+CRyq0MP1rGPx6qu4fJIiuXgNVzq5WpNvySKjLu6M=; b=uPJ53FMaL0f3Z6PwB93RvpFTzkb8AxC9NSw3NRPHw5pcIiu4REaT9iRvA4lnzl1En7 4iBoXQyrNVJbnpWwc3DvJDJgaplWJEgX5mZOfWnnkjqYxzSxC25e8viq2VS3Lf3Atapl suVyprMtp/N9W4lDenempbYtVypc99Ny6CEULDmaFOHH3BzahP+rcUd7GdgLfQWp7CSg hxiu9i7wIE9FMvtASC3f/9XAUBTjKokB4I0dbUJuYGaosN9aMDnqBss40fYobE1vNdNl 6IPE0zDW9SHhe2/nvYqx/JBKTJrRjsIJXAPfDFPzmuiC69fsmgk9XE5zEo1jze9CNtrL eqsg== X-Gm-Message-State: AOAM533Wc+9ZO2e3ab2SSJIMpRhGm6iBwlMxgdzGljUba4uy3CVXgBAk bpFFh83Y16TUWT5enaOqOzhPKA== X-Google-Smtp-Source: ABdhPJxRBZnwVrN5mfPlZqgpI52Qd3hNu9GOYY/E9bIWA0MosamJ/tI/ASBpOEiIxMQWYBucoMAVUA== X-Received: by 2002:a1c:2601:: with SMTP id m1mr15236488wmm.12.1603719381363; Mon, 26 Oct 2020 06:36:21 -0700 (PDT) Received: from localhost.localdomain (lfbn-nic-1-190-206.w2-15.abo.wanadoo.fr. [2.15.39.206]) by smtp.gmail.com with ESMTPSA id f7sm23688991wrx.64.2020.10.26.06.36.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Oct 2020 06:36:20 -0700 (PDT) From: Bartosz Golaszewski To: Jonathan Cameron , Lars-Peter Clausen , Peter Meerwald-Stadler , Michal Simek Subject: [PATCH 1/5] iio: adc: xilinx: use helper variable for &pdev->dev Date: Mon, 26 Oct 2020 14:36:05 +0100 Message-Id: <20201026133609.24262-2-brgl@bgdev.pl> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201026133609.24262-1-brgl@bgdev.pl> References: <20201026133609.24262-1-brgl@bgdev.pl> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201026_093627_431450_33950D4A X-CRM114-Status: GOOD ( 15.75 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-iio@vger.kernel.org, Bartosz Golaszewski , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Bartosz Golaszewski It's more elegant to use a helper local variable to store the address of the underlying struct device than to dereference pdev everywhere. Signed-off-by: Bartosz Golaszewski --- drivers/iio/adc/xilinx-xadc-core.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/iio/adc/xilinx-xadc-core.c b/drivers/iio/adc/xilinx-xadc-core.c index f93c34fe5873..8494eb424b33 100644 --- a/drivers/iio/adc/xilinx-xadc-core.c +++ b/drivers/iio/adc/xilinx-xadc-core.c @@ -1186,6 +1186,7 @@ static int xadc_parse_dt(struct iio_dev *indio_dev, struct device_node *np, static int xadc_probe(struct platform_device *pdev) { + struct device *dev = &pdev->dev; const struct of_device_id *id; struct iio_dev *indio_dev; unsigned int bipolar_mask; @@ -1195,10 +1196,10 @@ static int xadc_probe(struct platform_device *pdev) int irq; int i; - if (!pdev->dev.of_node) + if (!dev->of_node) return -ENODEV; - id = of_match_node(xadc_of_match_table, pdev->dev.of_node); + id = of_match_node(xadc_of_match_table, dev->of_node); if (!id) return -EINVAL; @@ -1206,7 +1207,7 @@ static int xadc_probe(struct platform_device *pdev) if (irq <= 0) return -ENXIO; - indio_dev = devm_iio_device_alloc(&pdev->dev, sizeof(*xadc)); + indio_dev = devm_iio_device_alloc(dev, sizeof(*xadc)); if (!indio_dev) return -ENOMEM; @@ -1226,7 +1227,7 @@ static int xadc_probe(struct platform_device *pdev) indio_dev->modes = INDIO_DIRECT_MODE; indio_dev->info = &xadc_info; - ret = xadc_parse_dt(indio_dev, pdev->dev.of_node, &conf0); + ret = xadc_parse_dt(indio_dev, dev->of_node, &conf0); if (ret) return ret; @@ -1250,7 +1251,7 @@ static int xadc_probe(struct platform_device *pdev) } } - xadc->clk = devm_clk_get(&pdev->dev, NULL); + xadc->clk = devm_clk_get(dev, NULL); if (IS_ERR(xadc->clk)) { ret = PTR_ERR(xadc->clk); goto err_free_samplerate_trigger; @@ -1276,7 +1277,7 @@ static int xadc_probe(struct platform_device *pdev) } ret = request_irq(xadc->irq, xadc->ops->interrupt_handler, 0, - dev_name(&pdev->dev), indio_dev); + dev_name(dev), indio_dev); if (ret) goto err_clk_disable_unprepare; -- 2.29.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel