Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3865642imm; Sat, 21 Jul 2018 05:05:04 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeBx0BiXL43iE6m0k3np3TEf3DhU2fql7jNHg/mOKY9Rn156hW9V2nYjF0puANmlOdimQNw X-Received: by 2002:a63:6743:: with SMTP id b64-v6mr5381374pgc.91.1532174704157; Sat, 21 Jul 2018 05:05:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532174704; cv=none; d=google.com; s=arc-20160816; b=bfB5+v8NwzEIR3OWSHgGl1rDcuIpM8ocvZgfZT97//NPzJyu81765m2FlWR8D8Zc0S c70BKgMJjQgLj1pzf4MoaCaB+CBbHhrALucd/bdGt1VemIjWoi8us1XJfvtSGwCT0YUb L4IV71v/eQMXXsLO2lPFtmpU7V2cT7TUAxCIHCZGcgd4xFQQNsgtHBurkU3x8l5y0guV xdOJlck5iVSaNzDT7zxoNdjzacFFANHpFr6qGnUPL0Y/y3Nb9h000F5TsxdAFEVvh8sH +3qWXiRL/f2CGtrhMx7sHrvruQqP9lotnHuyZdR3mtuEUFwxJpWD7WrcthnEhXs8fZb7 cqUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=x4Fkp/KHa7FEOEu7VoafhS/3yTx22+dgWdZXXxfohOc=; b=V5yn6icafGxEbHTTu1yLExnDUEoj4/05+phW/NYWbmsRUgvv5fGmUise55bJrA7njO 73/NIJbgBJfPhosvL8GIXSutErK6i2yBU3Im33HQYuofjhs2u9dLxTHdRrHsjm041zoN IacZFnODd69VqBmIQ6L6tQonX4CdrH4ayfb0r3y8daOD4XIzOYRPvMhepUdfKf56IvfD /du+59Cp6llnIDcrblRAZrb9fNvBSLarvlcRui3O52ZIOHmwLvKWQhpYIjxNw2Xl5NV6 Eioz6fMm5teco5MWPSa8zU78xJVOYUxdCVdzqPnpckpT/Xkyy8qt0/8wAxkJhVRJJHha u8bw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ojPWODIj; 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 v3-v6si3593004pgr.44.2018.07.21.05.04.49; Sat, 21 Jul 2018 05:05:04 -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=ojPWODIj; 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 S1727760AbeGUM4c (ORCPT + 99 others); Sat, 21 Jul 2018 08:56:32 -0400 Received: from mail-ed1-f67.google.com ([209.85.208.67]:43277 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727663AbeGUM4c (ORCPT ); Sat, 21 Jul 2018 08:56:32 -0400 Received: by mail-ed1-f67.google.com with SMTP id b20-v6so11797746edt.10; Sat, 21 Jul 2018 05:04:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=x4Fkp/KHa7FEOEu7VoafhS/3yTx22+dgWdZXXxfohOc=; b=ojPWODIjvniRPm8IkhnXQuB441H6P5TsZE3JMoai9Hc6HWmF/zYFBzeimHAnCANTMY hQo4KHoP040q2TPZ89qJ8jzXAJSeDLQd9JSj5yWVEv/IqM6nO8tVzjA6oMHdn2/GkZPt LwH5aiEaJZSppVO5CznrGzlrCeMqKdRbxjXL4b2JCu9KYIoG/93BUrcaL7P2BjpxfBrE T3PmHQft7OQNM/4HC3NfAyDSd/nMtQOlULKWRDTqVh19k/el0rQ3k3IhNVFQcEJhmGjy 53vJeBx00OtEA3Kh5BFgAijjHCxt7LBOcP18GwljyV/AR8g60OHOuTNHrMsrM3fAkVNx VGWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=x4Fkp/KHa7FEOEu7VoafhS/3yTx22+dgWdZXXxfohOc=; b=YVDxKHzD733tTZjD5xZMRFwMW36VRakXMwXH0fhVNSJ2doHxxHP2PqsE3H1XzY5+Ok 9s8fz2jkvd6AbqZS4xb6l5lC880b2RQw4kPmZYmLg13BZ3K+7v9TTxzVxsdVqFO+82UX kQXcvgR+Gy3bvYnB98H/vAeYUIsoC2JYrHzCvkGUh4wHAyJM6zItVJhbMlFQ7SK1hgRH ofOFwFiSQ36WbWt2mWhLhKyXfIXaZyooAJ8K/7M22uTcVzbImxVWEM30p6a3aAGJNEDh SKt4Mv/heRuaklDiLgDUPphW+9QA9ELRWbF78aZoKvsmGKfo4i7ptDuH+kuRDLG7lHQX 58PQ== X-Gm-Message-State: AOUpUlFv0KFRHZ77868llp250YGkjdCtqtstOHRewqBepD1g9KKvKYy3 fOHc289Om+c9zleJrXnwHJY= X-Received: by 2002:a50:c211:: with SMTP id n17-v6mr4373111edf.11.1532174639853; Sat, 21 Jul 2018 05:03:59 -0700 (PDT) Received: from dimapc.localnet (109-252-90-13.nat.spd-mgts.ru. [109.252.90.13]) by smtp.gmail.com with ESMTPSA id v3-v6sm1948840edq.92.2018.07.21.05.03.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 21 Jul 2018 05:03:59 -0700 (PDT) From: Dmitry Osipenko To: Marcel Ziswiler , "broonie@kernel.org" Cc: "linux-kernel@vger.kernel.org" , "jonathanh@nvidia.com" , "thierry.reding@gmail.com" , "tiwai@suse.com" , "lgirdwood@gmail.com" , "perex@perex.cz" , "linux-tegra@vger.kernel.org" , "alsa-devel@alsa-project.org" Subject: Re: [PATCH 2/2] ASoC: tegra: probe deferral error reporting Date: Sat, 21 Jul 2018 15:03:57 +0300 Message-ID: <2195096.d8yV6ZqeS2@dimapc> In-Reply-To: <1532174119.19673.24.camel@toradex.com> References: <20180720080424.31505-1-marcel@ziswiler.com> <8512069.csTsg4TRIJ@dimapc> <1532174119.19673.24.camel@toradex.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Saturday, 21 July 2018 14:55:21 MSK Marcel Ziswiler wrote: > On Sat, 2018-07-21 at 14:17 +0300, Dmitry Osipenko wrote: > > > On Saturday, 21 July 2018 12:56:15 MSK Mark Brown wrote: > > > > > On Fri, Jul 20, 2018 at 12:31:07PM +0000, Marcel Ziswiler wrote: > > > > > > > On Fri, 2018-07-20 at 13:16 +0100, Mark Brown wrote: > > > > > > > > > > ac97->sync_gpio = of_get_named_gpio(pdev- > > > > > > > > > > > > > >dev.of_node, > > > > > > > > > > > > > > > > > > > > > > > > > "nvidia,codec- > > > > > > > > > > > > sync- > > > > > > > > > > > > gpio", 0); > > > > > > > > > > > > > > > > > > if (!gpio_is_valid(ac97->sync_gpio)) { > > > > > > > > > > > > > > > > > > - dev_err(&pdev->dev, "no codec-sync GPIO > > > > > > supplied\n"); > > > > > > + ret = ac97->sync_gpio; > > > > > > + dev_err(&pdev->dev, "no codec-sync GPIO > > > > > > supplied: > > > > > > %d\n", ret); > > > > > > > > > > > > > > > > > > goto err_clk_put; > > > > > > > > > > > > > > > > > > } > > > > > > > > > > > > > > > This isn't reporting an error code associated with the attempt > > > > > to > > > > > find a > > > > > codec-sync GPIO, it's the result of some other operation. > > > > > > > > > > > > What exactly is then the of_get_named_gpio() above please doing > > > > if > > > > not getting the codec sync GPIO? I am not following you, sorry. > > > > > > > > > It's not in any way involved in setting the value of ret, whatever > > > value > > > that has it's nothing to do with that operation. > > > > > > The comment to gpio_is_valid() says that it "Returns GPIO number to > > use with > > Linux generic GPIO API, or one of the errno value on the error > > condition". > > Comment doesn't explicitly states that the returned GPIO number is > > always > > valid, but it is kinda implied. > > > Do you mean I should be assigning the return value of gpio_is_valid() > to ret and use that instead? No, gpio_is_valid() returns a boolean. I think your patch is fine as it is is. Probably Mark meant something like this: ac97->sync_gpio = of_get_named_gpio(pdev->dev.of_node, "nvidia,codec-sync-gpio", 0); if (ac97->sync_gpio < 0) { ret = ac97->sync_gpio; dev_err(&pdev->dev, "no codec-sync GPIO supplied: %d\n", ret); goto err_clk_put; } if (!gpio_is_valid(ac97->sync_gpio)) { ret = -EINVAL; goto err_clk_put; } But that is not needed because of_get_named_gpio() returns either a valid GPIO number or a error code.