Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5120581yba; Wed, 10 Apr 2019 11:47:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqztQ1fJKUS0XtYrtFwibOuZULSKHDRy9bgKvZEsxE68SGjxono6P9C4RwtHNBFLV/p5ho11 X-Received: by 2002:a65:5682:: with SMTP id v2mr43287067pgs.100.1554922040299; Wed, 10 Apr 2019 11:47:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554922040; cv=none; d=google.com; s=arc-20160816; b=gAMgEpbsdrW2bw3LUrepDsZwKOvE+zolT+yX6yeqLFFiS4U/dqNH0txAGOW0vVq90q VbUWNLNr4LDVF/nqime4Fpm6e9gmxSlSEvoS/XnohIxBh5IXJ1rNrn6/VXs8azxXcZwL XcdexhtVIWB2xcvEM2G29RiIAZUmzg4m+O7FsoEvXRZsbh4Ty1V6iDr33foLZoK2+XTC aBEflCaCwhOl3V/+fNjtF0NM6EREaqlSl6sx/Z6c2oDI6Ogrgt7Fw8XkVRbMd68wfXNN E2PwuORF03ug8DmIUYDcNP5EYdGAJw9HYNWbRed47Mq2SxxYp34Wq9CxOlSdOw6Q34/L AkTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=tR/tgWi0NWu/p8jUty40o4OgX03BGJEy7JzWJugTrTg=; b=SQAM532Tf8xE0laItBowFGZW1hUv6nIok5KC2aZl7Zkv5djM2VF+WVrcLQ96hZ+Cfx /C8a1MxxaU9z04tmHtKF6L0w3ftA6m6TCFau1RbwEQaNn6RcoNJogUiJ0juw2H5kn20j znOvVgrTGDM1IIpW7uNkzK2Lw6kgUU/+PUmP55gWLzZfHKjohWJijlyaJaRHVatAAGNK Gz+MNOVmI0Q6QtOspT8LuI7tRTVbxD+LYJifc26Ib3+QbqlMoe1giPLCzw9ugWmodjWZ 1C5cRpoEd5F6rvxf60B2eoBP6oFebZyJTQj5daAXY6taBAloar+oWuoHfERAZQ/YHXZa 3vfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=l8tHrCHy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z18si6711661pgv.299.2019.04.10.11.47.04; Wed, 10 Apr 2019 11:47:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=l8tHrCHy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732321AbfDJQ3E (ORCPT + 99 others); Wed, 10 Apr 2019 12:29:04 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:41627 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387925AbfDJQ2d (ORCPT ); Wed, 10 Apr 2019 12:28:33 -0400 Received: by mail-pl1-f193.google.com with SMTP id d1so1736153plj.8; Wed, 10 Apr 2019 09:28:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=tR/tgWi0NWu/p8jUty40o4OgX03BGJEy7JzWJugTrTg=; b=l8tHrCHyh+IqMwRszJzBwTaDmzvJKoNJ+URalOMbDC3tvrW/bV25yFooCf1BzdDd8b /F/zQuupt3JljsBgfTuXXGPFwtqrmO4cUAsLBrMyBc4RQF//9JJr0d95N2lmnD4bJOgg 6lAbjwGwohr7gH3DDbpqFu7T4gqN5NEVMHipmSKPy0P366huTIk0+GjLXakVqMh0reu3 ZOW23PU9JfzgsX9/KFwgh+Y+Obil7r7HFYQOHA3p2B/n0z9WU0tZjWi/JvD39FZ1YYh5 xuf/8/XBRQywJ4bFr7cLAcG2UYNjK27jVQvwIEYoX+k0+72SmyDd8isrNLbOuXaMcCPJ yb3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=tR/tgWi0NWu/p8jUty40o4OgX03BGJEy7JzWJugTrTg=; b=hPH01HhAZSS9DQuK+GWuRNX9jNM3VB47PjAbv2rKjGeKaJ1MAuijIX076BuM0nH5s2 EL1I2GQPYNP97kumq8bUYSjUOW+mgU5L/dMsg1W79oZZqs/6F3InA/C/DW2CTltJr5si g8L1lPJP8woeQQ9oJH4881dVcKhzsJnmCAsuI6QRh2Fb6xZeUCrfbmyvU1cvC5nhq2I9 PzqymSnV38aNYH7hx/2cHUnSfndoCsfmPxE0a9ImKGQLJywOuB+twvFqtpx0TJwHU+EQ mq5Cz7NUOSED1ZFDZKBEA1V2Ybb2DTm+pYGhLtW0wWK/UrNfMkG7Xx7e0ELrm+hgorX+ 3sCA== X-Gm-Message-State: APjAAAVi9XrQBRS0BwmDq0AmBM2EeMwZJODf2VV1MjCiqHxmloWpYz4+ OlUBfCql0xBhbtOww5urtMc= X-Received: by 2002:a17:902:7d81:: with SMTP id a1mr44620383plm.202.1554913712767; Wed, 10 Apr 2019 09:28:32 -0700 (PDT) Received: from localhost ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id z8sm44583797pgz.3.2019.04.10.09.28.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Apr 2019 09:28:32 -0700 (PDT) From: Guenter Roeck To: Wim Van Sebroeck Cc: linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org, Guenter Roeck , Matthias Brugger Subject: [PATCH 18/22] watchdog: mt7621_wdt: Use 'dev' instead of dereferencing it repeatedly Date: Wed, 10 Apr 2019 09:27:59 -0700 Message-Id: <1554913683-25454-19-git-send-email-linux@roeck-us.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1554913683-25454-1-git-send-email-linux@roeck-us.net> References: <1554913683-25454-1-git-send-email-linux@roeck-us.net> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Introduce local variable 'struct device *dev' and use it instead of dereferencing it repeatedly. The conversion was done automatically with coccinelle using the following semantic patches. The semantic patches and the scripts used to generate this commit log are available at https://github.com/groeck/coccinelle-patches Cc: Matthias Brugger Signed-off-by: Guenter Roeck --- drivers/watchdog/mt7621_wdt.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/watchdog/mt7621_wdt.c b/drivers/watchdog/mt7621_wdt.c index 9c943f1d57ec..cbb3c0dde136 100644 --- a/drivers/watchdog/mt7621_wdt.c +++ b/drivers/watchdog/mt7621_wdt.c @@ -133,18 +133,19 @@ static struct watchdog_device mt7621_wdt_dev = { static int mt7621_wdt_probe(struct platform_device *pdev) { + struct device *dev = &pdev->dev; mt7621_wdt_base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(mt7621_wdt_base)) return PTR_ERR(mt7621_wdt_base); - mt7621_wdt_reset = devm_reset_control_get_exclusive(&pdev->dev, NULL); + mt7621_wdt_reset = devm_reset_control_get_exclusive(dev, NULL); if (!IS_ERR(mt7621_wdt_reset)) reset_control_deassert(mt7621_wdt_reset); mt7621_wdt_dev.bootstatus = mt7621_wdt_bootcause(); watchdog_init_timeout(&mt7621_wdt_dev, mt7621_wdt_dev.max_timeout, - &pdev->dev); + dev); watchdog_set_nowayout(&mt7621_wdt_dev, nowayout); if (mt7621_wdt_is_running(&mt7621_wdt_dev)) { /* @@ -161,7 +162,7 @@ static int mt7621_wdt_probe(struct platform_device *pdev) set_bit(WDOG_HW_RUNNING, &mt7621_wdt_dev.status); } - return devm_watchdog_register_device(&pdev->dev, &mt7621_wdt_dev); + return devm_watchdog_register_device(dev, &mt7621_wdt_dev); } static void mt7621_wdt_shutdown(struct platform_device *pdev) -- 2.7.4