Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp5206672imm; Tue, 16 Oct 2018 06:52:57 -0700 (PDT) X-Google-Smtp-Source: ACcGV60RVhua94cnZV4ch8HJ+MKHT4c+bar08GoaZTOpzwPhnt3flWJ5HacEQlcNSZarPz0rpxFM X-Received: by 2002:a17:902:1e2:: with SMTP id b89-v6mr22062251plb.296.1539697977396; Tue, 16 Oct 2018 06:52:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539697977; cv=none; d=google.com; s=arc-20160816; b=OCfbQsbfFGlXyQGa3xNPkkByzwlomkbf1V53sZChS11H083CDQWeqCiUB8R9BjkmTR +KwiOfAFiXZwnDIMmK++372rotlNis8icn2rsNlHSDinIru3Gs5l0OqDjp7bW/KHGIZi lHJReFkXVcSRd/aHXqVUP5/yKWTvMb9aaTSmTWw15CNVYyNaY/n4DL4x3HbtvbhxdFux bb5+E1mB0JgbKg1pT4Iq1IDdfoJSjq/Nu0rbg8JoenOVq1obrnYeXIJoOC1NHKUFBmIg Kzk6fsf66/dSKhbOlvwxOeiaKtZYdQc8JvHoditJDsNcUC2WPe5KDz05mUxfbcKHLdHu wsDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=0GbGhX6sHSV23Grz6FVp5g23P7JfBj1mSGNji9fqc/A=; b=SUcJKPR7T5LNVaImDckv1YrM//uYL2IWG2zt4HsVaDH7rROAZGPXj9Bh/SOB+RVOys uZwptE6pER2pfFUj44KhHqK8fdwWBekHV1cct0zdLq3EqRARU1MlreJ8G0JXiyg3pBhP eyCFGAzyI1d4HnCRX57eFo82dvWpiYpWBsibnlWyIr/kfogf2zmTh7hYKJZvipk3Uh9n XAlb++fGgdoVrrF08SvDJnDV4ecDIWPwSCgIqj5YX4P2UuisuOG9JObW9O9Zj3Jkkve/ M1S7lMa/lRm9tzq8x1NsQscf6clS88jpbtai1PzDv81uQXTFVHB9DLE2nQILpi7XrVUR z+Sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fbxQFVOR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i21-v6si14307987pgj.51.2018.10.16.06.52.40; Tue, 16 Oct 2018 06:52:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fbxQFVOR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727208AbeJPVmd (ORCPT + 99 others); Tue, 16 Oct 2018 17:42:33 -0400 Received: from mail-qt1-f194.google.com ([209.85.160.194]:43603 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727043AbeJPVmd (ORCPT ); Tue, 16 Oct 2018 17:42:33 -0400 Received: by mail-qt1-f194.google.com with SMTP id q41-v6so25692508qtq.10 for ; Tue, 16 Oct 2018 06:51:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=0GbGhX6sHSV23Grz6FVp5g23P7JfBj1mSGNji9fqc/A=; b=fbxQFVORaqMROf0NDV+zGR7NKho01mkJ0aHn2FtNA59cVRxBskW9Mz9m0wsIUvffLj fvpyMnXd6pjpYlCRedmZ4Hmn60AXwet19i5+iL6A7r/q5BGXZ5VWwynJPHqMEZCJpu5m tXdNn9JZNcRk1fOGvWMJToEKYjny9cn1eVe4Mqom08tvg+EXlAo6O/PHqiCwgeJLd4Cd 3fg1/Hlk4zpObMaR++FFuQDhlcXL8vo2c7lzGhYMGAN8J0XC7t8gk/nRKf8/HeJsSNTd MDxgzNMfD0ixeYnyc0dKY37MxMi6gj5T+kO8Nw+qX0XuMyHA3fjc6/GBBNIXMC5uFOlB EItQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=0GbGhX6sHSV23Grz6FVp5g23P7JfBj1mSGNji9fqc/A=; b=V2ae1JdrQ2hZ+1fH/L680ULeo/1iS09HvlMAYiJsKrbM6Mbly3eqppm5A3pzOrJ+Qx DEjNflIP5qOYaSV2O48cjRsjuNUhfKAKcMFBAR0E/QL8HohfGbObmn0qQD8BgHYtZllC Ly6tMPbHtsz2vlI5aYgtqaHRk482vwVDhL1pXHYgzLNmqf83STYWpxG29uD4w5s0ErDN fh1WQ0kTEwBG0d26panzrnwNytubLEgGczBlr+VM3mWNKRtPlZaCi3HI+l7MM0ZGVp1B /JhlPgaTlox3uJI8L4dVWVWT8hRje7d2whTOq/b1YOreOgISiaqR3f40vYgBwg+yzp/9 QtEQ== X-Gm-Message-State: ABuFfoiDuvaCVCdOQbTjB493BQHz4aJ+a1q4mt9vRFkGiNQ3QHr5tm9l 8xwIUEuq+bJSwI3JFNV60WAXwIn3+rGb3c+Pl9I= X-Received: by 2002:ac8:6784:: with SMTP id b4-v6mr20683361qtp.373.1539697918458; Tue, 16 Oct 2018 06:51:58 -0700 (PDT) MIME-Version: 1.0 References: <20181016072244.1216-1-a.hajda@samsung.com> <20181016072244.1216-4-a.hajda@samsung.com> In-Reply-To: <20181016072244.1216-4-a.hajda@samsung.com> From: Andy Shevchenko Date: Tue, 16 Oct 2018 16:51:47 +0300 Message-ID: Subject: Re: [PATCH 3/3] drivers: use probe_err function in obvious cases To: Andrzej Hajda Cc: Greg Kroah-Hartman , Bartlomiej Zolnierkiewicz , Marek Szyprowski , "Rafael J. Wysocki" , Linux Kernel Mailing List , Javier Martinez Canillas , linux-arm Mailing List , Mark Brown Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 16, 2018 at 10:22 AM Andrzej Hajda wrote: > > The patch replaces obviously matching code with probe_err function. > There are many more places where probe_err could be used. > The patch shows how the new function should be used, and how it > improves the code. > --- a/drivers/gpio/gpio-pca953x.c > +++ b/drivers/gpio/gpio-pca953x.c > @@ -824,9 +824,7 @@ static int pca953x_probe(struct i2c_client *client, > reg = devm_regulator_get(&client->dev, "vcc"); > if (IS_ERR(reg)) { > ret = PTR_ERR(reg); > - if (ret != -EPROBE_DEFER) > - dev_err(&client->dev, "reg get err: %d\n", ret); > - return ret; > + return probe_err(&client->dev, ret, "reg get err: %d\n", ret); No need to assign ret above. As I mentioned, better to print a value for everyone. > } Please, split it at least one patch per subsystem. -- With Best Regards, Andy Shevchenko