From patchwork Wed Nov 2 04:10:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rakesh Sankaranarayanan X-Patchwork-Id: 14026 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3386648wru; Tue, 1 Nov 2022 21:19:53 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5EPrGSVCgHsXIbNiA4ycgijAH3mrGwDEvnPAHTPzoSHlYoh5LONUB/ZnIOmcv9Vj4Miit/ X-Received: by 2002:a17:906:cc48:b0:7a8:4a3b:11f7 with SMTP id mm8-20020a170906cc4800b007a84a3b11f7mr22107795ejb.388.1667362793235; Tue, 01 Nov 2022 21:19:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667362793; cv=none; d=google.com; s=arc-20160816; b=Kt6ZIHzkKRhYSk7FTYOyDToyvBQQqKprzEtkP8bFabZ4kVNRlhM4QCZt937ZIra/I3 tkYKR3CezO8jj3ConWuB/fDX1Dd7KM2nEa/ZmkvHqImSejQSvdXduZh7JKQusPUiqDGf Mzh1AK+mB6/5JH2U/h1zeYlscf0Pm8V94pGm8pqfsXaYM4sFiEP7SOA6oU3jpp7IPNwO ett1tihAwS7B1Of3DYxz9oSqyPdLROZbSmOnZzrOkSsVNIN3yS/VCCEFGATc1EjQH9hX +ua9ygFPJuiifNMLwRyLLGdkIBUQd3JGvRu9FgTAKxwEa0PjCsvqWc526BCAFuYCmNC3 +byA== 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=aN63oC2EFzEMliOcQ4Ye4Q0L5v5qw0kTAbBh3Y0KhKk=; b=Tbent02maIK83m0WNUHSEbAWvH3/KPMhhFLfmDneOwaSr4H1J/4UNONl4Q6NtGJhLC ep12UGBTFedu+qjGljEcjnXxk2/5QQZmc49a6uxs2x1FcFiv7BoII81lLhD7DXP9SFRB fSQHQVF/u/2baiTrdmAU0CRywmZr2uCRsK0/Gi1r3etXnJczWeGKpiYXoiwKi+kYnXYU kjzLSsX5xxgEu0JAvVhTH8HEMA74tuzFIoMfq6hEt7Qe0Hg+/KnR0hrp1nL1DofiSD2k d+K+rcsTwhhZTe9emO0ttfRSPHlRYgCvb/qqD1frsdvnNgCpDAZk36ToWROSV6YGkoIs Kv3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=gZLsJTEV; 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 sh6-20020a1709076e8600b0078e16203457si16610460ejc.5.2022.11.01.21.19.30; Tue, 01 Nov 2022 21:19:53 -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=@microchip.com header.s=mchp header.b=gZLsJTEV; 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 S230336AbiKBEQC (ORCPT + 99 others); Wed, 2 Nov 2022 00:16:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230161AbiKBEPZ (ORCPT ); Wed, 2 Nov 2022 00:15:25 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60D03248FB; Tue, 1 Nov 2022 21:14:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1667362493; x=1698898493; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=9GnNyz13QneI0oPfy3KJmDwliNeb7C9tr9KliRE0l1Y=; b=gZLsJTEVElUpMI4cqB3RQdhzTkDr4jZo3kJw52arjpoNkcIMZ8fbgeg0 o7cWUDU+ELrQcQI5YIVIIkfTTrPetrbrprjJyFLpslVHKE358aVcuTEpd 8WN6xPqh3nOmxB+NS9a5HbupyYj3yV0xNLtgwIBHqUoSiNjVxQbSHYaNw lDE2kYy4wPKCEiSXNuQX0zOPQTeJUVNs+PhaQHBWYNo1rnhBbGL2Q4JX9 N0C4/e2Vt0MNBF+fmcV0+xPKyll3T4Cgab6BWVCFpcDWzcYWHlI41WpiN gKRQmuxX+lh3wJYnEMvM2JRhWEThjWebt1TCIxgLB51441qD4/mEUqMN4 w==; X-IronPort-AV: E=Sophos;i="5.95,232,1661842800"; d="scan'208";a="181530261" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 01 Nov 2022 21:14:53 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) 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.12; Tue, 1 Nov 2022 21:14:52 -0700 Received: from che-lt-i67786lx.microchip.com (10.10.115.15) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2507.12 via Frontend Transport; Tue, 1 Nov 2022 21:14:48 -0700 From: Rakesh Sankaranarayanan To: , CC: , , , , , , , , , Subject: [PATCH net-next 6/6] net: dsa: microchip: add dev_err_probe in probe functions Date: Wed, 2 Nov 2022 09:40:58 +0530 Message-ID: <20221102041058.128779-7-rakesh.sankaranarayanan@microchip.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221102041058.128779-1-rakesh.sankaranarayanan@microchip.com> References: <20221102041058.128779-1-rakesh.sankaranarayanan@microchip.com> MIME-Version: 1.0 X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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?1748356608089324294?= X-GMAIL-MSGID: =?utf-8?q?1748356608089324294?= Probe functions uses normal dev_err() to check error conditions and print messages. Replace dev_err() with dev_err_probe() to have more standardized format and error logging. Signed-off-by: Rakesh Sankaranarayanan --- drivers/net/dsa/microchip/ksz8863_smi.c | 9 ++++----- drivers/net/dsa/microchip/ksz9477_i2c.c | 8 +++----- drivers/net/dsa/microchip/ksz_spi.c | 8 +++----- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/drivers/net/dsa/microchip/ksz8863_smi.c b/drivers/net/dsa/microchip/ksz8863_smi.c index ddb40838181e..9e49c2cc0550 100644 --- a/drivers/net/dsa/microchip/ksz8863_smi.c +++ b/drivers/net/dsa/microchip/ksz8863_smi.c @@ -152,11 +152,10 @@ static int ksz8863_smi_probe(struct mdio_device *mdiodev) ®map_smi[i], dev, &rc); if (IS_ERR(dev->regmap[i])) { - ret = PTR_ERR(dev->regmap[i]); - dev_err(&mdiodev->dev, - "Failed to initialize regmap%i: %d\n", - ksz8863_regmap_config[i].val_bits, ret); - return ret; + return dev_err_probe(&mdiodev->dev, + PTR_ERR(dev->regmap[i]) + "Failed to initialize regmap%i\n", + ksz8863_regmap_config[i].val_bits); } } diff --git a/drivers/net/dsa/microchip/ksz9477_i2c.c b/drivers/net/dsa/microchip/ksz9477_i2c.c index caa9acf1495c..db4aec0a51dc 100644 --- a/drivers/net/dsa/microchip/ksz9477_i2c.c +++ b/drivers/net/dsa/microchip/ksz9477_i2c.c @@ -30,11 +30,9 @@ static int ksz9477_i2c_probe(struct i2c_client *i2c, rc.lock_arg = &dev->regmap_mutex; dev->regmap[i] = devm_regmap_init_i2c(i2c, &rc); if (IS_ERR(dev->regmap[i])) { - ret = PTR_ERR(dev->regmap[i]); - dev_err(&i2c->dev, - "Failed to initialize regmap%i: %d\n", - ksz9477_regmap_config[i].val_bits, ret); - return ret; + return dev_err_probe(&i2c->dev, PTR_ERR(dev->regmap[i]), + "Failed to initialize regmap%i\n", + ksz9477_regmap_config[i].val_bits); } } diff --git a/drivers/net/dsa/microchip/ksz_spi.c b/drivers/net/dsa/microchip/ksz_spi.c index 4f2186779082..96c52e8fb51b 100644 --- a/drivers/net/dsa/microchip/ksz_spi.c +++ b/drivers/net/dsa/microchip/ksz_spi.c @@ -71,11 +71,9 @@ static int ksz_spi_probe(struct spi_device *spi) dev->regmap[i] = devm_regmap_init_spi(spi, &rc); if (IS_ERR(dev->regmap[i])) { - ret = PTR_ERR(dev->regmap[i]); - dev_err(&spi->dev, - "Failed to initialize regmap%i: %d\n", - regmap_config[i].val_bits, ret); - return ret; + return dev_err_probe(&spi->dev, PTR_ERR(dev->regmap[i]), + "Failed to initialize regmap%i\n", + regmap_config[i].val_bits); } }