From patchwork Thu Mar 2 11:01:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 63346 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp4173637wrd; Thu, 2 Mar 2023 03:14:08 -0800 (PST) X-Google-Smtp-Source: AK7set+cS5FzFvowZRStbCkqR4pbKudC8IFUP3ezCLQqgr9J2gDq+CjwFPEzJV/TFUP0+Jlofvi5 X-Received: by 2002:a50:fc0e:0:b0:4c0:1120:a167 with SMTP id i14-20020a50fc0e000000b004c01120a167mr2004036edr.32.1677755648195; Thu, 02 Mar 2023 03:14:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677755648; cv=none; d=google.com; s=arc-20160816; b=ENYpnOyU72sNL3gm1w2s7ypSY2zShwzyr+ih+myli9LElIdQ7oB0XhlphVxynVeT0u 1jAredG9b/PirOYw+JCb2BfgTQxk2f2dhsmOJOI83NuEXlYHZ7zYthClccZa7dnWqb06 oPN8nFWmkGIdb7lmC5cy08Ds8y0BmGc7iMLyPlAcr9og0xb9e2s/2LPNN8gOXVmb+1nH bPSNXlzAr/q/a02oGRp2+Pqw3vsbuwAFaEp2xc+HFahgizIAL3rBXZSJkg7aTM4CD7ba 4xAwW9ImMSW917XlKbbDNp8mxWTX38eOqKYEKspwFcyKDd0KKpcfRzBdjImEQJjQFjPS kWxA== 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=rMwbsO/rbhkzdk1XM3AdVybikP4fH2gM551yJCKrLcU=; b=cbMpb1lSeZUBr9wIDp9++IlmRPCVfy/IpMRN54e6KJ2ndZS6oKF2tsyaZ6sIjylosL OvVRoVYn9q9RypaUqxRDPnch8198KbL17VbgqRolLRKMaOgPs9G45t4/ClBN7tSA2uNe gXZAihkTTcuKgbshZKqJqYl6YZaVs5XIeq+fwnuvw8u1vUdBbWcRjfcLrfU+VgwwR55M vRIUvaI1BfIp651mC8fmM8Jra9M4GpGoYmOorQcis3Cv9meddlFfFIttKSVZ3j6ZFQ75 XIWdqkj4DSgrWD/kLRNjDcr9IVE+oS6ECMxxkx88NHrlxaqvv8B+2hZULGTDMkgAYyua ZrTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=ryLkpByo; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bm20-20020a170906c05400b008d672111f11si2053717ejb.479.2023.03.02.03.13.45; Thu, 02 Mar 2023 03:14:08 -0800 (PST) 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=@microchip.com header.s=mchp header.b=ryLkpByo; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230081AbjCBLB4 (ORCPT + 99 others); Thu, 2 Mar 2023 06:01:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50410 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229719AbjCBLBt (ORCPT ); Thu, 2 Mar 2023 06:01:49 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29197457DB; Thu, 2 Mar 2023 03:01:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1677754895; x=1709290895; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=hyWxrfmSizpBS+n92kWqaBMSXOT85gSrHaQamS5MXSQ=; b=ryLkpByoZuydQnf0QOQtP53i2Cf2DFYDICH+2sH6oTN8i82XmCmJxFdw Uu6okBb6qeLWEqYNZyjAmfef3PfGtWougzkyNOrjqPsg3UhZ3VZDREyyG og3IIcdfVai/lQYBvUXOO83TSojkWFuo8rnKPpno19hkhjK2xtT/Y88ql +ZTNHMYeygfN6rDJEoc+lJ+5DJmv6jHwGOaOV4u3i2NJNpBLVMiSFsDJn /rN3E0VUyHOiv3B1tDUXRkou5uFSgy+dwbNwXjcx5vxoq1BIZJHS7hFrU pr4cmqy20p7UgxyM4OMte2TNL8HpCHgHnD1FUBrpDSmvlQq4cap79uBeF w==; X-IronPort-AV: E=Sophos;i="5.98,227,1673938800"; d="scan'208";a="199564352" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 02 Mar 2023 04:01:34 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Thu, 2 Mar 2023 04:01:33 -0700 Received: from m18063-ThinkPad-T460p.mchp-main.com (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2507.16 via Frontend Transport; Thu, 2 Mar 2023 04:01:30 -0700 From: Claudiu Beznea To: , , , CC: , , , Claudiu Beznea Subject: [PATCH 1/4] pinctrl: at91-pio4: use devm_clk_get_enabled() Date: Thu, 2 Mar 2023 13:01:13 +0200 Message-ID: <20230302110116.342486-2-claudiu.beznea@microchip.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230302110116.342486-1-claudiu.beznea@microchip.com> References: <20230302110116.342486-1-claudiu.beznea@microchip.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS 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?1759254306808548858?= X-GMAIL-MSGID: =?utf-8?q?1759254306808548858?= Use devm_clk_get_enabled() to simplify the code. Signed-off-by: Claudiu Beznea --- drivers/pinctrl/pinctrl-at91-pio4.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/drivers/pinctrl/pinctrl-at91-pio4.c b/drivers/pinctrl/pinctrl-at91-pio4.c index 39b233f73e13..0aceb723f94c 100644 --- a/drivers/pinctrl/pinctrl-at91-pio4.c +++ b/drivers/pinctrl/pinctrl-at91-pio4.c @@ -1098,7 +1098,7 @@ static int atmel_pinctrl_probe(struct platform_device *pdev) if (IS_ERR(atmel_pioctrl->reg_base)) return PTR_ERR(atmel_pioctrl->reg_base); - atmel_pioctrl->clk = devm_clk_get(dev, NULL); + atmel_pioctrl->clk = devm_clk_get_enabled(dev, NULL); if (IS_ERR(atmel_pioctrl->clk)) { dev_err(dev, "failed to get clock\n"); return PTR_ERR(atmel_pioctrl->clk); @@ -1219,25 +1219,19 @@ static int atmel_pinctrl_probe(struct platform_device *pdev) i, irq); } - ret = clk_prepare_enable(atmel_pioctrl->clk); - if (ret) { - dev_err(dev, "failed to prepare and enable clock\n"); - goto clk_prepare_enable_error; - } - atmel_pioctrl->pinctrl_dev = devm_pinctrl_register(&pdev->dev, &atmel_pinctrl_desc, atmel_pioctrl); if (IS_ERR(atmel_pioctrl->pinctrl_dev)) { ret = PTR_ERR(atmel_pioctrl->pinctrl_dev); dev_err(dev, "pinctrl registration failed\n"); - goto clk_unprep; + goto irq_domain_remove_error; } ret = gpiochip_add_data(atmel_pioctrl->gpio_chip, atmel_pioctrl); if (ret) { dev_err(dev, "failed to add gpiochip\n"); - goto clk_unprep; + goto irq_domain_remove_error; } ret = gpiochip_add_pin_range(atmel_pioctrl->gpio_chip, dev_name(dev), @@ -1254,10 +1248,7 @@ static int atmel_pinctrl_probe(struct platform_device *pdev) gpiochip_add_pin_range_error: gpiochip_remove(atmel_pioctrl->gpio_chip); -clk_unprep: - clk_disable_unprepare(atmel_pioctrl->clk); - -clk_prepare_enable_error: +irq_domain_remove_error: irq_domain_remove(atmel_pioctrl->irq_domain); return ret; From patchwork Thu Mar 2 11:01:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 63347 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp4173738wrd; Thu, 2 Mar 2023 03:14:25 -0800 (PST) X-Google-Smtp-Source: AK7set8UDjwYga0jMlnNMrOeUZcYMYeEt0PB1GQD+aOXJpTH95lhKxI+gBQy5JtlDPl4ZPRLzbVC X-Received: by 2002:aa7:c7da:0:b0:4ac:b6b2:1233 with SMTP id o26-20020aa7c7da000000b004acb6b21233mr9397789eds.30.1677755665705; Thu, 02 Mar 2023 03:14:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677755665; cv=none; d=google.com; s=arc-20160816; b=FXW2eY6PNQMDpimog5IuTBPMREopKA1Gdb/vp3DUqAr3p7rIjxCIbUuPoLNU98VwdZ IZE7L8Uokim0A1IE24NQOGgyHZuupyuYXE4GGo10GtPgYbuLz59V1F7KYGJdhd+MeKIY gZQ92ts697al50mMJQ7Z8aveTCo9ZEqcTTTHB9jduA/ruxRgqlcRnFrIuOPW1c7ZPs90 VJGlZxi2e7lTgDHXmClHYNyRy3zeDmFuUP9871kjGSfumjmGAsN8OFov3/3ORwGlqVmT fw/qQSkGQuPq8Y/Qb21kq3dZA+ZLt+QZVJvSNNgPZ5KzeLjzl1MNyagS1OP9QJAEDjas mEpw== 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=i5uiaQIBB1nw1Bti8q4qPd+HT06s31N5bD3RKRmLgQc=; b=wc6Lcheg2w6EeSiHLi9BnCCuiaUrY1BHplS6nPB7TjzeJ4px1gnEg7KvgbbhIqDNwN wPy4xH1WxqWF5dcoO+v/fIEEUBd8p+gjvILfHEnGo1HXHPHe/wuIwYiCN7eTx9/h4Wm/ Kal+JhTBUBDa82UHF6B5ygyLwYMrJOXnwQ76qBSQJh8xlyW0+wS7Sn1DIY0O3ctWL9Cu deCX4pxuPcOQxI0PyiIJekoSfLg2lThxVFfCNx/yUI9wsUrn2L47meBBrA6mMtw1QTqb v+y32+4yHNdIafJU82Mudcf7DS0d9Brppr84Pw4PmJIv74yqnNLllAlG4pYKXO4sLex8 9Orw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=dYO4Di4C; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j3-20020aa7c0c3000000b004ad152a9df0si4490121edp.154.2023.03.02.03.14.03; Thu, 02 Mar 2023 03:14:25 -0800 (PST) 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=@microchip.com header.s=mchp header.b=dYO4Di4C; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230070AbjCBLB7 (ORCPT + 99 others); Thu, 2 Mar 2023 06:01:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229947AbjCBLBv (ORCPT ); Thu, 2 Mar 2023 06:01:51 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42BA9460AF; Thu, 2 Mar 2023 03:01:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1677754899; x=1709290899; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Bf1Z7/sfzlJmrMOEOjhTIy25zAMrI0ji7izXGtHopIU=; b=dYO4Di4CJyy1Aaqk+akeLRkiMp+nyps3JxGJRHa9nF5ncv8oQ/3O+bP5 hN3EuQS5f/kktg4A3OWE380E8dR33b8w6pBEhk/pjNBYSAdNpknTzB4gj CgTMUZE2qMcX3j/BOS05Lw+PP+WrDW7wLUokSNhkDRtN8U1oxRjmR8e9e Kh8lZbNKYBA2G1YMalGIcQeS1A/BUPieFSVP8r2DdvgrXL88G2wZAgFrq xTSQ8IBclg1zDGJu+bgUwfg048ig+QiMSaXYlskmZIwtqECjJ1f6s1QVC uyJ4ILPQgmyMM9Y8WOWsH/dhfrZl3cjjgANzvISV7u+ayxLql7gOijMUC A==; X-IronPort-AV: E=Sophos;i="5.98,227,1673938800"; d="scan'208";a="203271644" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 02 Mar 2023 04:01:37 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Thu, 2 Mar 2023 04:01:35 -0700 Received: from m18063-ThinkPad-T460p.mchp-main.com (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2507.16 via Frontend Transport; Thu, 2 Mar 2023 04:01:33 -0700 From: Claudiu Beznea To: , , , CC: , , , Claudiu Beznea Subject: [PATCH 2/4] pinctrl: at91-pio4: use device_get_match_data() Date: Thu, 2 Mar 2023 13:01:14 +0200 Message-ID: <20230302110116.342486-3-claudiu.beznea@microchip.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230302110116.342486-1-claudiu.beznea@microchip.com> References: <20230302110116.342486-1-claudiu.beznea@microchip.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS 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?1759254325044487361?= X-GMAIL-MSGID: =?utf-8?q?1759254325044487361?= Use device_get_match_data() to simplify the code. Signed-off-by: Claudiu Beznea --- drivers/pinctrl/pinctrl-at91-pio4.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/pinctrl/pinctrl-at91-pio4.c b/drivers/pinctrl/pinctrl-at91-pio4.c index 0aceb723f94c..93023d0fd75b 100644 --- a/drivers/pinctrl/pinctrl-at91-pio4.c +++ b/drivers/pinctrl/pinctrl-at91-pio4.c @@ -1067,7 +1067,6 @@ static int atmel_pinctrl_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct pinctrl_pin_desc *pin_desc; const char **group_names; - const struct of_device_id *match; int i, ret; struct atmel_pioctrl *atmel_pioctrl; const struct atmel_pioctrl_data *atmel_pioctrl_data; @@ -1079,12 +1078,11 @@ static int atmel_pinctrl_probe(struct platform_device *pdev) atmel_pioctrl->node = dev->of_node; platform_set_drvdata(pdev, atmel_pioctrl); - match = of_match_node(atmel_pctrl_of_match, dev->of_node); - if (!match) { - dev_err(dev, "unknown compatible string\n"); + atmel_pioctrl_data = device_get_match_data(dev); + if (!atmel_pioctrl_data) { + dev_err(dev, "Invalid device data\n"); return -ENODEV; } - atmel_pioctrl_data = match->data; atmel_pioctrl->nbanks = atmel_pioctrl_data->nbanks; atmel_pioctrl->npins = atmel_pioctrl->nbanks * ATMEL_PIO_NPINS_PER_BANK; /* if last bank has limited number of pins, adjust accordingly */ From patchwork Thu Mar 2 11:01:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 63344 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp4170938wrd; Thu, 2 Mar 2023 03:07:25 -0800 (PST) X-Google-Smtp-Source: AK7set/cD5B7dbelvYFxvNNho3Bt+KfrJqKIuwsdjRt5MEVBkbh2A27RRFeYMvuBeHYkV4wFKpKP X-Received: by 2002:aa7:d44c:0:b0:4ad:7481:c2fe with SMTP id q12-20020aa7d44c000000b004ad7481c2femr9653083edr.22.1677755245014; Thu, 02 Mar 2023 03:07:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677755244; cv=none; d=google.com; s=arc-20160816; b=i0jruKAlzK+eOHJiuXBGn1zBJyHRADPZi9J0PWCsGSpFP8QBg6aJ4nDbLs/TGAjUbc jXwXtpxfLGrrgjqQ5Qm8So3w/NVjwQXYIyS5rxrsyTpqt84tQC+z3vcY7iNnP4JG+qSL w7Je3F5plrkbfgsBa2DnbOevhK+U6UY2rFH5SQNzTXQdzYxI8KUMCyzTbvPULDOQDMr2 qE3btg+htKHgO9AZi+cGZNCGePCScsBDEIuL9+xJDi0S5I4h9gO49pm/msME5asXSxuf efC44CCdQXnfrsfCLGNJLgJckhVZxx//9FgbnX5NzQ2s/dEtb10e8WR1NY1sYhDssCdn 31bg== 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=rAConIH8oRnQDg8tTPGuNoHLNaJMUa0nvUVhG9OfTSI=; b=TtmSSmdTDzledTVoBU3jd2s1d/0+5Mxlm80GKHzK+PIqlwhaWeVU+e8CzEgS6Q+58t 9OsQa/vYXy4ksE6yqDxI0FyoDzsU9u/xeSfE5iaOUFd2bDaKd3r5FotjU2XWjSliausT TmoSWAbJjsUXcTkdB/sdxK8IfAjMjUPEGE2gmYBwGsnwgyjCLfts9NNQnF6F+Vi3+Z/S hY8eZUrqYcZM3EvjQa6CM0D0HZUJrBHbEFuiKwvBVuPtNRZJYAwFRp8TVLBLBaaHNUwn +Od8JzqULSQxFFbUax+yacl9PNUxsaBn1gBOlirOt/Rhpe7oyfd1gi5CV6/2i5Kvsjae VPqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=T1xvdqkY; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b15-20020aa7c90f000000b004bfe31dbd46si1882173edt.199.2023.03.02.03.07.02; Thu, 02 Mar 2023 03:07:24 -0800 (PST) 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=@microchip.com header.s=mchp header.b=T1xvdqkY; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230122AbjCBLCC (ORCPT + 99 others); Thu, 2 Mar 2023 06:02:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229957AbjCBLBw (ORCPT ); Thu, 2 Mar 2023 06:01:52 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6DC448E1B; Thu, 2 Mar 2023 03:01:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1677754900; x=1709290900; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=gX9P046dW17ln8lj8QobxPkcMbEPnX2RXibkQe5EQhM=; b=T1xvdqkYKaBAI5U8Hkx0x/VUgRKCQVSHKRzIMTZIwxZwGgS2m/gupWMe 0sVRC4uElOfp6a3CxgXoOiy52gbil+jHpfiLvWoewIqF5LqoSH1Ba+H/4 TOoq9IsjBoz+h3lam//H8Uz1fOe4xTBUKUDlb5gK5Rz1C/DuyksSeT+sA 7SLEyi4+yEenbpPUoYC18wdeT8dARazmsv6QHGNAbTSxkSahTcZxkAoth mynpNvhykr4Pp4eJe16UnOCzvgRt5XY/l2ZhrVEfx+PRYjunCz6DvI84l RXv3y/gFbJYeS/jYQCW+AFZaPRJ46JU2uqhmbQH/y8lXuhQDpDCOYjaFH Q==; X-IronPort-AV: E=Sophos;i="5.98,227,1673938800"; d="scan'208";a="199564392" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 02 Mar 2023 04:01:39 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Thu, 2 Mar 2023 04:01:38 -0700 Received: from m18063-ThinkPad-T460p.mchp-main.com (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2507.16 via Frontend Transport; Thu, 2 Mar 2023 04:01:36 -0700 From: Claudiu Beznea To: , , , CC: , , , Claudiu Beznea Subject: [PATCH 3/4] pinctrl: at91-pio4: use dev_err_probe() Date: Thu, 2 Mar 2023 13:01:15 +0200 Message-ID: <20230302110116.342486-4-claudiu.beznea@microchip.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230302110116.342486-1-claudiu.beznea@microchip.com> References: <20230302110116.342486-1-claudiu.beznea@microchip.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS 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?1759253883739225703?= X-GMAIL-MSGID: =?utf-8?q?1759253883739225703?= Use dev_err_probe() to simplify the code. Signed-off-by: Claudiu Beznea --- drivers/pinctrl/pinctrl-at91-pio4.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/drivers/pinctrl/pinctrl-at91-pio4.c b/drivers/pinctrl/pinctrl-at91-pio4.c index 93023d0fd75b..783968182bc7 100644 --- a/drivers/pinctrl/pinctrl-at91-pio4.c +++ b/drivers/pinctrl/pinctrl-at91-pio4.c @@ -1079,10 +1079,9 @@ static int atmel_pinctrl_probe(struct platform_device *pdev) platform_set_drvdata(pdev, atmel_pioctrl); atmel_pioctrl_data = device_get_match_data(dev); - if (!atmel_pioctrl_data) { - dev_err(dev, "Invalid device data\n"); - return -ENODEV; - } + if (!atmel_pioctrl_data) + return dev_err_probe(dev, -ENODEV, "Invalid device data\n"); + atmel_pioctrl->nbanks = atmel_pioctrl_data->nbanks; atmel_pioctrl->npins = atmel_pioctrl->nbanks * ATMEL_PIO_NPINS_PER_BANK; /* if last bank has limited number of pins, adjust accordingly */ @@ -1097,10 +1096,8 @@ static int atmel_pinctrl_probe(struct platform_device *pdev) return PTR_ERR(atmel_pioctrl->reg_base); atmel_pioctrl->clk = devm_clk_get_enabled(dev, NULL); - if (IS_ERR(atmel_pioctrl->clk)) { - dev_err(dev, "failed to get clock\n"); - return PTR_ERR(atmel_pioctrl->clk); - } + if (IS_ERR(atmel_pioctrl->clk)) + return dev_err_probe(dev, PTR_ERR(atmel_pioctrl->clk), "failed to get clock\n"); atmel_pioctrl->pins = devm_kcalloc(dev, atmel_pioctrl->npins, @@ -1200,10 +1197,8 @@ static int atmel_pinctrl_probe(struct platform_device *pdev) atmel_pioctrl->irq_domain = irq_domain_add_linear(dev->of_node, atmel_pioctrl->gpio_chip->ngpio, &irq_domain_simple_ops, NULL); - if (!atmel_pioctrl->irq_domain) { - dev_err(dev, "can't add the irq domain\n"); - return -ENODEV; - } + if (!atmel_pioctrl->irq_domain) + return dev_err_probe(dev, -ENODEV, "can't add the irq domain\n"); atmel_pioctrl->irq_domain->name = "atmel gpio"; for (i = 0; i < atmel_pioctrl->npins; i++) { From patchwork Thu Mar 2 11:01:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 63345 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp4173202wrd; Thu, 2 Mar 2023 03:13:01 -0800 (PST) X-Google-Smtp-Source: AK7set8Wpx3dYLGTAPy/Ue6/EJTlc6xlgd5iPpZNazfE3aJqIDFCCJZMfuswD3s/ttOTLoWXL3dO X-Received: by 2002:a17:906:2509:b0:902:874:9c31 with SMTP id i9-20020a170906250900b0090208749c31mr1616578ejb.35.1677755581653; Thu, 02 Mar 2023 03:13:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677755581; cv=none; d=google.com; s=arc-20160816; b=j5fsKgMu7w5FmMv3FIFXk7rJa4tE4eGin9Y2n+SSzzIjUYKaJTg1CbgXvpvU1ROlAh j+xfKgv9WCnyqmDiiFhAcotP/YM1Zrsneq8qqOIQOHMyP7POgGeXqPHQuR4yUzRy1Cda vlhiLi3udwvYYzyxqYzO4ofFJUjRC/JGyB7lSDiw/9cRsy3LUVQG7w7UMbYo7vkCLUn5 ekWaHcosQmrfI1iOG+jgT+VRBk2L0rh8ThXeFNU4N9HxEK5wLXAzvNNtAER4nGHK0iry 8oQZg0Wx7ALfLKee4oos96qNc7lfd9FwSGEE1CK6kjMt370jmZeud6q8Qh2HdKvkovQr Uuww== 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=++MK97J9V5JckRn68nyP8/6dBc1hAZo+IaDxbTCg+h4=; b=UVP2L5ZMlVDZO4QgxwKbUdAREZ3IOYXcD1LqLPVy/CaXW7HdCINHEW4xRCPsL4tr5d YxZ4qm5n4QyRhFly/aKsS9tHanh30U6Hexc/aMQb2falS+APYJ+BCFAIY3HWNlqmicKj /z/c422Dsddkv5sS/nD0hI3QAZgWO6kWPrqwszMeFxDCdAWoWqMWMwDSCpp6i25xLMhn gJpEUQiPigX6B3xPA2MW5YZkTDJ/SQu/gQLwfBnjA64zehbLp7CCCnt85Vbh3mCw0vHj F81RT0fVPJGYh95x7Cc6cMyEpJwUJgj002chskDUfGuADxtkO+1eQygET7NSWe0qHu58 zbBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b="YM0jVCj/"; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u16-20020a1709067d1000b008cd04d9ea6csi1835618ejo.433.2023.03.02.03.12.38; Thu, 02 Mar 2023 03:13:01 -0800 (PST) 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=@microchip.com header.s=mchp header.b="YM0jVCj/"; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230150AbjCBLCE (ORCPT + 99 others); Thu, 2 Mar 2023 06:02:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230020AbjCBLBx (ORCPT ); Thu, 2 Mar 2023 06:01:53 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C560E4743C; Thu, 2 Mar 2023 03:01:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1677754901; x=1709290901; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=mY3cAYnyOKmX1eK5KErN3GRqlF6KJtvyLr/5G2kFtdA=; b=YM0jVCj/lx1/MU0uhBunApAJLzP//SxcCkp7yrmAZIKyk9Z3MJdemmcn QtGDaFeGzrhPMzAbRrTY72hXgo+AmmvhDoBz91AH6iH4CSvajQDHY0C1C udJtTbnzuvbjnwRLSrfU072jhd/G5DmqSy/F+SPOLBclZaGu/ksjx1V5M EcD7UiYUi7KXPUXXvI3KnfHyv15G8JUtHtAREmLdULsWodMT/svhebzTz 1Z1cGnzEXu1cmqe25eMoVJHdiMSV7pyI5ZCa+CGW4cEA9IRnvERRXaqnB SHl/FV4/eStvXNrZIeqJgkh01QUlihX3Bu16Ou7auHruw7Q3xPgd0mrSO A==; X-IronPort-AV: E=Sophos;i="5.98,227,1673938800"; d="scan'208";a="202949584" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 02 Mar 2023 04:01:41 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Thu, 2 Mar 2023 04:01:40 -0700 Received: from m18063-ThinkPad-T460p.mchp-main.com (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2507.16 via Frontend Transport; Thu, 2 Mar 2023 04:01:38 -0700 From: Claudiu Beznea To: , , , CC: , , , Claudiu Beznea Subject: [PATCH 4/4] pinctrl: at91-pio4: use proper format specifier for unsigned int Date: Thu, 2 Mar 2023 13:01:16 +0200 Message-ID: <20230302110116.342486-5-claudiu.beznea@microchip.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230302110116.342486-1-claudiu.beznea@microchip.com> References: <20230302110116.342486-1-claudiu.beznea@microchip.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS 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?1759254236689756290?= X-GMAIL-MSGID: =?utf-8?q?1759254236689756290?= Use %u instead of %d as line is unsigned int. Signed-off-by: Claudiu Beznea --- drivers/pinctrl/pinctrl-at91-pio4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pinctrl/pinctrl-at91-pio4.c b/drivers/pinctrl/pinctrl-at91-pio4.c index 783968182bc7..d6426367594e 100644 --- a/drivers/pinctrl/pinctrl-at91-pio4.c +++ b/drivers/pinctrl/pinctrl-at91-pio4.c @@ -1144,7 +1144,7 @@ static int atmel_pinctrl_probe(struct platform_device *pdev) pin_desc[i].number = i; /* Pin naming convention: P(bank_name)(bank_pin_number). */ - pin_desc[i].name = kasprintf(GFP_KERNEL, "P%c%d", + pin_desc[i].name = kasprintf(GFP_KERNEL, "P%c%u", bank + 'A', line); group->name = group_names[i] = pin_desc[i].name;