Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2630178pxb; Fri, 5 Nov 2021 01:48:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxPXEoN9+5RnhxnnfAj/XOLhcS48IaFvo7QItSHiZO/CixSPXoTz1W39rzVtPtpQMigMj38 X-Received: by 2002:a50:ee01:: with SMTP id g1mr49722246eds.389.1636102118963; Fri, 05 Nov 2021 01:48:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1636102118; cv=none; d=google.com; s=arc-20160816; b=o8GIROvY0lu3sHd8P9cBOfqTfaahnXq+5W/E9ltOGSRI2e6fbXHVL8OJJ+fsIF2URE F6OtVX5QuJPwsYLU59cPkLKPhE8Ij4joar37DQsHHqepmbvFXlvErFd/8SEl/FUDlFRd ALJznLB96Av4PvEoZFd+7+cAEIrr0RVsjnEwud4kalWMQPjNOTBWE6SyJK9lJBBrVayt xGU/Fxj06DoaF8CRVvC30MdWiBx9qqCuuAYk29GlQv4aWYGbFPcVwCl/SdUQMmrdQOIV m4qjmdJ+lUa0c2JHpugumwENEgfmWyDD8OHjLnowp8+AX+Fu0FKUhEgXwsxKpa2SFiVL yDWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=kSgk2ciNGtw8xJ3oWPzajm/Xh9QiAXiadxHLU95ZwFM=; b=0qWuP5HF4LkiT69Zp+cr6KU2AXgVbABG39xMeerUdcXsJWVmN1yvvekXWtC9UIaLwI teho5ybm+NERueAs2D9VSSjGApRkg/Eh8Z4qkQivCL20d0OB3mcu1NbiAHuahXTupOZ+ S+gsLA2NcQ0gXqPeZndxrRLggQKWmD/YMpSzm3Ugflhz5JI8sg7xnGfWQ02mwQbjC89/ y5MWIVfRAvlAdE59E0hyWEIQCtzH54ON9XdS1ue+2MWVTRqnxu+IQmzH2ff33oCirITv MfzDJ+ulTepBoINyD5KSLEvq13+oVREDphlicSekUG+6E7+TDQll5s2C0ey9xEzTA/hb SfzA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r21si10456871edb.376.2021.11.05.01.48.15; Fri, 05 Nov 2021 01:48:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231676AbhKEHSG (ORCPT + 99 others); Fri, 5 Nov 2021 03:18:06 -0400 Received: from mx22.baidu.com ([220.181.50.185]:40298 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230073AbhKEHSF (ORCPT ); Fri, 5 Nov 2021 03:18:05 -0400 Received: from BC-Mail-Ex03.internal.baidu.com (unknown [172.31.51.43]) by Forcepoint Email with ESMTPS id BF7C92CAB7A78CB7F91C; Fri, 5 Nov 2021 15:15:16 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BC-Mail-Ex03.internal.baidu.com (172.31.51.43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2242.12; Fri, 5 Nov 2021 15:15:16 +0800 Received: from LAPTOP-UKSR4ENP.internal.baidu.com (172.31.63.8) by BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Fri, 5 Nov 2021 15:15:16 +0800 From: Cai Huoqing To: CC: Greg Kroah-Hartman , "Rafael J. Wysocki" , Subject: [PATCH v2] driver core: platform: Make use of the helper function dev_err_probe() Date: Fri, 5 Nov 2021 15:15:09 +0800 Message-ID: <20211105071509.969-1-caihuoqing@baidu.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.31.63.8] X-ClientProxiedBy: BC-Mail-EX02.internal.baidu.com (172.31.51.42) To BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When possible using dev_err_probe() helps to properly deal with the PROBE_DEFER error, the benefit is that DEFER issue will be logged in the devices_deferred debugfs file. Signed-off-by: Cai Huoqing --- v1->v2: *Revert the change of variable name 'dev'. drivers/base/platform.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/base/platform.c b/drivers/base/platform.c index 598acf93a360..7109351366c8 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c @@ -258,8 +258,9 @@ int platform_get_irq(struct platform_device *dev, unsigned int num) int ret; ret = platform_get_irq_optional(dev, num); - if (ret < 0 && ret != -EPROBE_DEFER) - dev_err(&dev->dev, "IRQ index %u not found\n", num); + if (ret < 0) + return dev_err_probe(&dev->dev, ret, + "IRQ index %u not found\n", num); return ret; } -- 2.25.1