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++) { From patchwork Wed Nov 2 15:29:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 14306 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3686878wru; Wed, 2 Nov 2022 08:31:23 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5g7kf13p6neh7+9daLmabTVcdxvMGqzfLlu5KWsvG+Qp106zmHpcXKwpxaQXIxAwNWkKlh X-Received: by 2002:a17:902:d4c7:b0:186:8cda:c9c3 with SMTP id o7-20020a170902d4c700b001868cdac9c3mr24949156plg.154.1667403083075; Wed, 02 Nov 2022 08:31:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667403083; cv=none; d=google.com; s=arc-20160816; b=KVAtNsgNxcS3retoMJWWzZF+Z8diS4J9zQ+em//FNex6CZ+A/InCQJxR7JKYdZQdv0 OebRhbITEMFBHeYqvE6DqgD5UYc0pEWd0lT0QL11aWtwnyUyYzG7spb6axxPjvgc6ujV keH62ghyTsxkwUnX+V911g90Dx2rhG9mUMh0dg4bwFR3qOahR1mVRytLPdsQfOX0ReN9 wSB+ugo+MXhhxXKzWJhde6WUEXJlFDvUPXSnU+4vgrXMzpeDRKftMvYtKFZBJSWyACuF egYn7Nzsqbb9TjQedO0bYoIOZbTme0xmZuvsqAEGzGG5DyPHId95COAzy/W2U3Qmomjq l0cw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=eE5TUM05YWnGl2k8DZ76piLkSkEgKT4t5ZkWBzs6dN8=; b=IJTR54uCool/w9A8N33rfg6AsZ28fUWtKaluNQ3Dbls5VMAS48DaevDRAWQrpsUpCj U63RX34yz6v8d/2b1YILWNnJxtlaOoA93vsNBqt2Hx3zNN/I9p3NpHHty9X2fHD0IG/0 4F1UeoU0O2VkxbzRr47eOTB2hla95ylFss5ocilyP7fQNLRS3kdudg66RNGgMfh/RYdD Sc0XOdEZVY/HVlHJdgnxgoRCbowFTVE3ubvBKrHXvwIfZocYvhQgX/oMugbaKdwwHElw SeHjgBgQ3DyToFGk6c58b1WiKPlzOG22/vVgi77NBA7MX/4eIm85tJ0cjwytHCOQWT37 qpYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="aqstbC/T"; 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 w184-20020a6382c1000000b0046248881576si4876565pgd.157.2022.11.02.08.30.54; Wed, 02 Nov 2022 08:31:23 -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="aqstbC/T"; 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 S230525AbiKBP3Z (ORCPT + 99 others); Wed, 2 Nov 2022 11:29:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230402AbiKBP3G (ORCPT ); Wed, 2 Nov 2022 11:29:06 -0400 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3EF317E3A; Wed, 2 Nov 2022 08:29:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1667402941; x=1698938941; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=v0fHpdGAbu0arnH6xgJnxwue3Lb0+yaD3o4o1bu4gMc=; b=aqstbC/TO/2bBEPXECsE3XvCtdR5t9ana0+pUJkSe/hxv5tqEazZm5xQ j6wcMpq0TjD6zouPf3gI82IZ2sKZm7k7Gpe3tMhPJVy9Urh9Be0OxM+wf GZdxYngOprEtSS/Mws6kydhZUpqTQjDUu2v+QFCbqVdSuKXl9UrFz7L7a VkCQbaLnTaTTUDb50fRPZBY3TLe+Sq8BCFT0x2u7HacT5MSaTMZNl/H36 irwCzdSf9GtG1+M83v212ngjdRVCTbhm02VFByHn78zv9yjIcHSxZrNgB GFKfZveTBNE9FPR/PbbuINlfBcfV+w41v5xDGSMnXN81+to/PAxkhlK5L A==; X-IronPort-AV: E=McAfee;i="6500,9779,10519"; a="371532208" X-IronPort-AV: E=Sophos;i="5.95,234,1661842800"; d="scan'208";a="371532208" 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="634303823" X-IronPort-AV: E=Sophos;i="5.95,234,1661842800"; d="scan'208";a="634303823" 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 C1D6AB7; 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 2/2] pinctrl: merrifield: Use temporary variable for struct device Date: Wed, 2 Nov 2022 17:29:15 +0200 Message-Id: <20221102152915.22995-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221102152915.22995-1-andriy.shevchenko@linux.intel.com> References: <20221102152915.22995-1-andriy.shevchenko@linux.intel.com> 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?1748398854911738276?= X-GMAIL-MSGID: =?utf-8?q?1748398854911738276?= Use temporary variable for struct device to make code neater. Signed-off-by: Andy Shevchenko --- drivers/pinctrl/intel/pinctrl-merrifield.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/pinctrl/intel/pinctrl-merrifield.c b/drivers/pinctrl/intel/pinctrl-merrifield.c index 527957ea35b7..c0845bb1e9e3 100644 --- a/drivers/pinctrl/intel/pinctrl-merrifield.c +++ b/drivers/pinctrl/intel/pinctrl-merrifield.c @@ -897,17 +897,18 @@ static const struct pinctrl_desc mrfld_pinctrl_desc = { static int mrfld_pinctrl_probe(struct platform_device *pdev) { + struct device *dev = &pdev->dev; struct mrfld_family *families; struct mrfld_pinctrl *mp; void __iomem *regs; size_t nfamilies; unsigned int i; - mp = devm_kzalloc(&pdev->dev, sizeof(*mp), GFP_KERNEL); + mp = devm_kzalloc(dev, sizeof(*mp), GFP_KERNEL); if (!mp) return -ENOMEM; - mp->dev = &pdev->dev; + mp->dev = dev; raw_spin_lock_init(&mp->lock); regs = devm_platform_ioremap_resource(pdev, 0); @@ -919,9 +920,7 @@ static int mrfld_pinctrl_probe(struct platform_device *pdev) * to the registers. */ nfamilies = ARRAY_SIZE(mrfld_families), - families = devm_kmemdup(&pdev->dev, mrfld_families, - sizeof(mrfld_families), - GFP_KERNEL); + families = devm_kmemdup(dev, mrfld_families, sizeof(mrfld_families), GFP_KERNEL); if (!families) return -ENOMEM; @@ -939,13 +938,13 @@ static int mrfld_pinctrl_probe(struct platform_device *pdev) mp->groups = mrfld_groups; mp->ngroups = ARRAY_SIZE(mrfld_groups); mp->pctldesc = mrfld_pinctrl_desc; - mp->pctldesc.name = dev_name(&pdev->dev); + mp->pctldesc.name = dev_name(dev); mp->pctldesc.pins = mrfld_pins; mp->pctldesc.npins = ARRAY_SIZE(mrfld_pins); - mp->pctldev = devm_pinctrl_register(&pdev->dev, &mp->pctldesc, mp); + mp->pctldev = devm_pinctrl_register(dev, &mp->pctldesc, mp); if (IS_ERR(mp->pctldev)) { - dev_err(&pdev->dev, "failed to register pinctrl driver\n"); + dev_err(dev, "failed to register pinctrl driver\n"); return PTR_ERR(mp->pctldev); }