Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1408198rwb; Fri, 19 Aug 2022 03:13:42 -0700 (PDT) X-Google-Smtp-Source: AA6agR7AY9jzQxNqpWtD1DhZ3Fauw/vJzzwyesY3VGxJgKyqoZBuWvYNJegxm28MMiY2p06YDVJs X-Received: by 2002:a17:902:b10d:b0:172:a530:dd12 with SMTP id q13-20020a170902b10d00b00172a530dd12mr6946497plr.98.1660904021993; Fri, 19 Aug 2022 03:13:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660904021; cv=none; d=google.com; s=arc-20160816; b=lFibMjpTKckGKWLhdrA4fJvM3x35eBEyHbx3/K+l39xxj6dqREzsf3uST6s/UZNoFw gDngWO7sBNhVfC942ghAgBlQiNY+y1Xr7N4GyfxJEChnRcIreLZlzJRNkCHPGDGsiSFy xoc9PDqa2o3bjtYv80L256gisIC3HKppMGAG0j0T46Glm71kHk+J/h2Cizk2g8iEufHE Xg7aZDxQak7xfkGU87JajXymYkZXj4PIbwBRaoEGDeJh7KTLCOGHj0rMW++zZjhWWjPq 6Jx50wGL6eCJxEUjL8b5vqMKRVjnlFLWymBQyrae9fmusCwKsZvqlRHdadn0BXBr6BpI J/3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=GMO8QS/YkYMKQ5H02m5iGabT8/gPgdnhh5OEL7LY9Y0=; b=AQ9X6Pt+yOGsfAnsq1sPdd8BGo4/gurIhMud6lMERNO8UNfFO/67mGcrkcsUc38BK2 kRt6gSaGkmkoOgirwFOlXYefNtEvNqFe5wbn+qndFaI1+ZiKz+MhqfEqW84NtfNW2Hn1 2eiokLu/sMkxIQQLR5btL19Xwca9Syim77AcXbjgyKXeW13SKdRQjggTAljg/VV8cVRZ JLlO39d0cR2SqQCzCCwpGosXxa8wUN0HhOYuvN/skhz79diRwcABymASOFGp1eHqgiCl nnC11M/83wOwtuademzN50i/It8QOvxzPtASkwMBkMczWuCSby/aR2qSlXskwEqVdr7h KS1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BCorilEC; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d4-20020a170903230400b001708af3828fsi4441962plh.62.2022.08.19.03.13.29; Fri, 19 Aug 2022 03:13:41 -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=@linuxfoundation.org header.s=korg header.b=BCorilEC; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348094AbiHSJm1 (ORCPT + 99 others); Fri, 19 Aug 2022 05:42:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346456AbiHSJmY (ORCPT ); Fri, 19 Aug 2022 05:42:24 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB0ED1D0C9 for ; Fri, 19 Aug 2022 02:42:23 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4A042615D5 for ; Fri, 19 Aug 2022 09:42:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 502A6C433D6; Fri, 19 Aug 2022 09:42:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660902142; bh=pEN+et5gf6W626fbns6sKMRGFSpCUpImxJQGhoBbmn0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=BCorilECWp86FSIJOu7M4oaEdM3MAsWX/zHqayk7i5SYDEBuY+2MjZl3DvWef19Vd X8ciVRr/Kl/QZaKLkL9VIyrxwb8NlS+7whX2hTIczPU2XFfNm3bRYe0Ac1Qjo1+1a0 fD8g65kmdKHUr26PqfHgQN6h3oYbl/bH6VGHTipo= Date: Fri, 19 Aug 2022 11:42:15 +0200 From: Greg KH To: Yang Yingliang Cc: linux-kernel@vger.kernel.org, rafael@kernel.org Subject: Re: [PATCH -next] driver core: switch to use dev_err_probe() Message-ID: References: <20220819094656.1945653-1-yangyingliang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220819094656.1945653-1-yangyingliang@huawei.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 On Fri, Aug 19, 2022 at 05:46:56PM +0800, Yang Yingliang wrote: > Use dev_err_probe() to simplify code and print error code. > > Signed-off-by: Yang Yingliang > --- > drivers/base/core.c | 8 +++----- > 1 file changed, 3 insertions(+), 5 deletions(-) > > diff --git a/drivers/base/core.c b/drivers/base/core.c > index 753e7cca0f40..e51a09f9d0ec 100644 > --- a/drivers/base/core.c > +++ b/drivers/base/core.c > @@ -2507,11 +2507,9 @@ static ssize_t uevent_store(struct device *dev, struct device_attribute *attr, > int rc; > > rc = kobject_synth_uevent(&dev->kobj, buf, count); > - > - if (rc) { > - dev_err(dev, "uevent: failed to send synthetic uevent\n"); > - return rc; > - } > + if (rc) > + return dev_err_probe(dev, rc, > + "uevent: failed to send synthetic uevent\n"); I do not understand this at all, this is not on the probe path at all, so why is this function needed? Have you tested this? What was the resulting output before and after this change? thanks, greg k-h