From patchwork Wed Nov 2 15:29:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 14305 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3686834wru; Wed, 2 Nov 2022 08:31:18 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7j0/CLTly3GNfePlhzbfMYrW3pyLq2hjycNuOnlE6dTKDAJn9oui2KVLxqWBU2RbC9KoU3 X-Received: by 2002:a62:b411:0:b0:56c:5afe:649f with SMTP id h17-20020a62b411000000b0056c5afe649fmr25680735pfn.60.1667403078109; Wed, 02 Nov 2022 08:31:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667403078; cv=none; d=google.com; s=arc-20160816; b=uvbNwOfCDKAlSEJvGDTnqljjFHSpV+uxqU1P/9gUV0LmAVtxEYOknry0H7e3+EaCh0 Kb35DthR2Wy6ythQd4TKQmLVL/LJJEBPytNekweWqSCY+LUi+04T+YZJfBGagpmzD3sb qZufVLpvKGqr1yGYJZHeZfwqqnoo5RJowGpqPvOYUHf2wK3piy44LKHSb1+7VGfzWUR/ xIsdKUtGzCQWD3YHmq8XvypdhxytZaba0LRNRyDRkzms/WJrH+S60OWTQDLcvNBkEjT0 llnfBV0q/yfRjnwC6E5PvXgtvXuiFE18TrQT0LQFbBFMUZY0/3yW+14nkqjw88xvwPq4 gsiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=tVi+UU4kQDVUpg48R44tRBD83UtS+SRKH5lUhbf4MMA=; b=MSJ/WwtKNmaux9jFBIqHWqBdZCUzmzpoEIhx4cgFDjWzNpQTsHywbN5pxauIvHbJqh aQoldAaOfth5gylgV3B1urFWpxEFLjSABU8Nc+hrPgPN58IVSqWhOSD5A4FYUWLg7IBL 4dAY861LuCxuIgsVkTI3V7qGylnJfiNjm7lnfBrHZpC4CFPlNym8LRHy0senx21rpCo3 6pUIP028NCebJVOBOgHoxLJtnDPewn2V1+gLcv90nFn9SkbAjr47gNf75PMP4/Ag04sQ rboMw0Pv/ARXdO4CDmywynQUVQO7f71G73ilVAaxZLqHsXmlHKxJiZFVZgpOuQVGZYAI Rw9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=a3NoB4JP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q17-20020a17090311d100b00176a87603dbsi17743641plh.156.2022.11.02.08.30.52; Wed, 02 Nov 2022 08:31:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=a3NoB4JP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230505AbiKBP3U (ORCPT + 99 others); Wed, 2 Nov 2022 11:29:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230465AbiKBP3F (ORCPT ); Wed, 2 Nov 2022 11:29:05 -0400 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DAA2A1D672; Wed, 2 Nov 2022 08:28:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1667402937; x=1698938937; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=e489D8kifr+m/racweh+WkS14YJhuJ+dmY25HGLU1B8=; b=a3NoB4JPS6pOz+bhRc1vdnJ8pdhvfnNj5FVNJlojRR7dBPXGSHA+wcH7 NxumtBRisBFr0EY0cuCpJsPGKRPHOy0pKgJfs5F7vu+BTFfxXpEWQRFVc 67D6eLjIBcR37C5nRThBYd1nSzKzfdLTUL3TD22JVBG030RJOpmpMdhQT rl8oyLWP8/PnpujhSPeIaFSWfhROqs7/FXXqeqicdcnjXahC0VJMSP9QP zCkTVGpg4HsL/SzeuD4tigZ590PxChuK0BBe0sbM5Q/M8YFd3UN62Kld2 Kp8sh7OXVYRAMSXiKFXx19fubi3k/qbhfQj4OHVCwSRVHXnZhiSYgB1oc Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10519"; a="371532207" X-IronPort-AV: E=Sophos;i="5.95,234,1661842800"; d="scan'208";a="371532207" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Nov 2022 08:28:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10519"; a="634303822" X-IronPort-AV: E=Sophos;i="5.95,234,1661842800"; d="scan'208";a="634303822" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga002.jf.intel.com with ESMTP; 02 Nov 2022 08:28:55 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id B71CAF7; Wed, 2 Nov 2022 17:29:18 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Mika Westerberg , Andy Shevchenko , Linus Walleij Subject: [PATCH v1 1/2] pinctrl: intel: Use temporary variable for struct device Date: Wed, 2 Nov 2022 17:29:14 +0200 Message-Id: <20221102152915.22995-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748398849972494269?= X-GMAIL-MSGID: =?utf-8?q?1748398849972494269?= Use temporary variable for struct device to make code neater. Signed-off-by: Andy Shevchenko Reviewed-by: Mika Westerberg --- drivers/pinctrl/intel/pinctrl-intel.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/drivers/pinctrl/intel/pinctrl-intel.c b/drivers/pinctrl/intel/pinctrl-intel.c index fe5bf2184cbf..e15629348cb5 100644 --- a/drivers/pinctrl/intel/pinctrl-intel.c +++ b/drivers/pinctrl/intel/pinctrl-intel.c @@ -1522,14 +1522,15 @@ static int intel_pinctrl_probe_pwm(struct intel_pinctrl *pctrl, int intel_pinctrl_probe(struct platform_device *pdev, const struct intel_pinctrl_soc_data *soc_data) { + struct device *dev = &pdev->dev; struct intel_pinctrl *pctrl; int i, ret, irq; - pctrl = devm_kzalloc(&pdev->dev, sizeof(*pctrl), GFP_KERNEL); + pctrl = devm_kzalloc(dev, sizeof(*pctrl), GFP_KERNEL); if (!pctrl) return -ENOMEM; - pctrl->dev = &pdev->dev; + pctrl->dev = dev; pctrl->soc = soc_data; raw_spin_lock_init(&pctrl->lock); @@ -1538,8 +1539,8 @@ int intel_pinctrl_probe(struct platform_device *pdev, * to the registers. */ pctrl->ncommunities = pctrl->soc->ncommunities; - pctrl->communities = devm_kcalloc(&pdev->dev, pctrl->ncommunities, - sizeof(*pctrl->communities), GFP_KERNEL); + pctrl->communities = devm_kcalloc(dev, pctrl->ncommunities, + sizeof(*pctrl->communities), GFP_KERNEL); if (!pctrl->communities) return -ENOMEM; @@ -1603,7 +1604,7 @@ int intel_pinctrl_probe(struct platform_device *pdev, offset = (value & CAPLIST_NEXT_MASK) >> CAPLIST_NEXT_SHIFT; } while (offset); - dev_dbg(&pdev->dev, "Community%d features: %#08x\n", i, community->features); + dev_dbg(dev, "Community%d features: %#08x\n", i, community->features); /* Read offset of the pad configuration registers */ offset = readl(regs + PADBAR); @@ -1632,14 +1633,13 @@ int intel_pinctrl_probe(struct platform_device *pdev, return ret; pctrl->pctldesc = intel_pinctrl_desc; - pctrl->pctldesc.name = dev_name(&pdev->dev); + pctrl->pctldesc.name = dev_name(dev); pctrl->pctldesc.pins = pctrl->soc->pins; pctrl->pctldesc.npins = pctrl->soc->npins; - pctrl->pctldev = devm_pinctrl_register(&pdev->dev, &pctrl->pctldesc, - pctrl); + pctrl->pctldev = devm_pinctrl_register(dev, &pctrl->pctldesc, pctrl); if (IS_ERR(pctrl->pctldev)) { - dev_err(&pdev->dev, "failed to register pinctrl driver\n"); + dev_err(dev, "failed to register pinctrl driver\n"); return PTR_ERR(pctrl->pctldev); } @@ -1681,10 +1681,11 @@ const struct intel_pinctrl_soc_data *intel_pinctrl_get_soc_data(struct platform_ { const struct intel_pinctrl_soc_data * const *table; const struct intel_pinctrl_soc_data *data = NULL; + struct device *dev = &pdev->dev; - table = device_get_match_data(&pdev->dev); + table = device_get_match_data(dev); if (table) { - struct acpi_device *adev = ACPI_COMPANION(&pdev->dev); + struct acpi_device *adev = ACPI_COMPANION(dev); unsigned int i; for (i = 0; table[i]; i++) {