Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp506461lqd; Wed, 24 Apr 2024 08:41:45 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX6sfl/OqeCgGpAyVnMpGpN+7S5R++jY+vg3556SV+21pFQLxc3l4jW9wSB+nL6GE5WKZKkQvrGFTteNOQkTdnmUgMsbJsIaHZdl7gaxg== X-Google-Smtp-Source: AGHT+IEv3qqtLru4b4d6neJrc6TLErfy+XUtrWmoktzSWMlXfV5Qfan+8HwKD4OumgSyBCdPDdoK X-Received: by 2002:a05:6512:6c7:b0:51b:ec31:750c with SMTP id u7-20020a05651206c700b0051bec31750cmr1940704lff.16.1713973305456; Wed, 24 Apr 2024 08:41:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713973305; cv=pass; d=google.com; s=arc-20160816; b=B1mTayXHura5TveMjZwErpkWASbRj05b4roEntzNpV3ulBfLKoqyfJNpGc9BoBEJ9q 2J1tgEph0PJ38yye/4CDuykQ8A86TDErTdU8UkP3Q9dY64gvGjeHkji6lLjjc+8yiHr/ tP1+UhEUaJibaKeswb1H3wQv2twuAR+bdTSKlHH2nlA0K6PS0jxl7tjZ/84+JYqTzi+S JyE+Eqao64XMB5k2xm3JEcacP2tX26+1uF2NYiL/D3LJZOyv06kIBOts6Xnuw1vC1sEp dQQBXQQ9wCLl8IzCm92LZT98HjB9+hrtc8oLv4pwZNBctYrD798jIGic+FkkUnpxL1Ab ySDQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=kN0hHEeupGSSgCE7fWY20jL26gsYlFQ3vjjtg0lU+j8=; fh=6654fiHhiFZXmVo+2oKGyTwGHcxfNuc6R/4oCKRwn+M=; b=F+qBSnUkUVj94cBrunXNo5QnyWVPZbGi+Fhbb9nFDGcx0G/tzbxwDKpLSlPbUQqojh IAioqlP07ETaPv9H3c+ygo+3uehUYDRoAoObR2rnbZFWOBCxOeNVcwvLMLGlMsrjaXPm Md1d0ZEovRvnSe3PNiu2QkvCwtItxabSLFYarL8gSeoLBebXBhPIGEgKs56hA27Ntrdo a7HM0VGLkezxahrZ75D9/f0BLV+J7MZpWVaLSCLRCCfc5OJR3eq0yvQ+xmXyvkbFtPFd 8FPcG7YWqr0XYXLfQHIea4RHfpMdmPkF4hafRVUnp2yT0/CVZxhHhKKYQlPaK/h1txj9 S9Tw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=a8qYTfmX; arc=pass (i=1 dkim=pass dkdomain=bgdev-pl.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-157204-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-157204-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id s23-20020a508d17000000b0056e69cc8320si5717919eds.175.2024.04.24.08.41.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 08:41:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-157204-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=a8qYTfmX; arc=pass (i=1 dkim=pass dkdomain=bgdev-pl.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-157204-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-157204-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id A431D1F24107 for ; Wed, 24 Apr 2024 15:33:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1560A165FB3; Wed, 24 Apr 2024 15:30:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="a8qYTfmX" Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 59B9A15EFDB for ; Wed, 24 Apr 2024 15:30:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713972625; cv=none; b=kKYycrCFf3jdP7t+SwuMKTDHzoFto8eN640fcTt22RovZWfvk5cjfWY15rHn+5m/iDFOPRnoE0yGRlinobrZSwiDrxWlv1SF8pb/yP2CzMmoyCJcZfgaLqW3JIr22cIip3WcIbt8Ebm+Vd4c5Pi2a6EXWcu4ab6yA0RQ8xHlZeY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713972625; c=relaxed/simple; bh=WrxU+iK2u+Wu8wwi+GibzMLwpaSndL/Suh4PRa2Redw=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=JFFaYGB4oeTjN+1eGpu84xobl32IcqgpLnZqnzsbqEOV21o5/ksra/vAFOApzegu13DrdcxUBZGTBc2gFKwUF9NteSHdUne1nJ/TzZBr58Pr78+Ss8/he9BLltrq35hYDecVG4KPGcZibiIlcs+K4RZD6XEQW0zAO82I/Af/y90= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=a8qYTfmX; arc=none smtp.client-ip=209.85.167.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Received: by mail-lf1-f45.google.com with SMTP id 2adb3069b0e04-51abf1a9332so7481050e87.3 for ; Wed, 24 Apr 2024 08:30:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1713972621; x=1714577421; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=kN0hHEeupGSSgCE7fWY20jL26gsYlFQ3vjjtg0lU+j8=; b=a8qYTfmXzFdX9chUZKS0GFutyxQUkwaOQe6UtpXzDk6CDXoDnOJ10Ao5XsA15vL8UE JLD2oSv3RkajURDTH6HrMNZPgRIgScZaLyW/4rKMAlIVESjMDJEwEJnb6EUX/c3x4J2W eQYqRBmKgC9yZuwhH+EpqU9jNp7G3T7odjIs63yNmtJE+pICNvzScGNR72qbcwiAnWIO Uf9JPkYlQmpbNNVshUxP3GqHfaTRIQei5FabfbNqStblqfrLb8AtyZIfTQUCH9HyyMC3 qCODIre+yssNeKv1mY+LbsvYV11bHg7ExEtATNtEMd74T5uW2vGcPdzys0wv5rPB4nDG jvNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713972621; x=1714577421; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kN0hHEeupGSSgCE7fWY20jL26gsYlFQ3vjjtg0lU+j8=; b=ovaafhRun3YHdiPsV8jQlGcK2x9f2IeQKyo4bjGRUI2ryMmBz9PbpCN0x4bu7fyr2d /ciiihiONZdqYSDAYmvDCIF6zK2CQEiM4JcMCjkmFl4D7jzUNjtqQsKEdmTiepI0PR4y dXhxkoUkcv4EDEV1XleiGi7HljvgcmAoXM4kRDOZYSybt8+Yhh/LRNT19xqEDUBfqfsj 5jIEux4m8FdqR1ysCD4qVaE5bGGdTR6Bq0Fq/QNTCL9THNIuI5HvOnssm1bskBeWeOjP w/pCuQo4LccEtrqb8EiWmxC1ft4X8p3lwCj15W4GExrv4+Czaq9QWfFQKdkdVRtzwbhv BHoA== X-Forwarded-Encrypted: i=1; AJvYcCVNeWh8aTuVe7EPaXMST477w3jLMAfq7wzfd9cJ7LqLLjnEioVRHq6dTyof46pP8Bo5DRlmlLFu0sVqOYJzBrio+lF7BHyvmrqXQmdf X-Gm-Message-State: AOJu0Yyzhn7Bld1GAHE+rNk13Z+0bLd9R8Tz63+VAm4ULu/zFndH6RV8 3I8+DufFEztRjIHmi1NM3anrnyROGdKETFp0TMWRBSesNtnqeDNZnQnsmQi6wboFj4Cm55f/mog NS2DHMxMt3A1DKw5P0O3FmClVEIDo1a8HmfKreQ== X-Received: by 2002:a05:6512:287:b0:516:cd83:a96a with SMTP id j7-20020a056512028700b00516cd83a96amr2069705lfp.37.1713972621326; Wed, 24 Apr 2024 08:30:21 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240424122932.79120-1-brgl@bgdev.pl> <0f8ba1b5-490e-4961-80e2-7942f66730ec@linaro.org> In-Reply-To: From: Bartosz Golaszewski Date: Wed, 24 Apr 2024 17:30:10 +0200 Message-ID: Subject: Re: [PATCH v2] Bluetooth: qca: set power_ctrl_enabled on NULL returned by gpiod_get_optional() To: Luiz Augusto von Dentz Cc: Bartosz Golaszewski , quic_zijuhu , Krzysztof Kozlowski , Marcel Holtmann , linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, Wren Turkal Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Apr 24, 2024 at 5:24=E2=80=AFPM quic_zijuhu wrote: > > On 4/24/2024 10:52 PM, Bartosz Golaszewski wrote: > > On Wed, 24 Apr 2024 at 16:46, Krzysztof Kozlowski > > wrote: > >> > >> On 24/04/2024 14:29, Bartosz Golaszewski wrote: > >>> From: Bartosz Golaszewski > >>> > >> > >>> qcadev->susclk =3D devm_clk_get_optional(&serdev->dev, = NULL); > >>> if (IS_ERR(qcadev->susclk)) { > >>> @@ -2355,10 +2360,13 @@ static int qca_serdev_probe(struct serdev_dev= ice *serdev) > >>> qcadev->bt_en =3D devm_gpiod_get_optional(&serdev->dev,= "enable", > >>> GPIOD_OUT_LOW); > >>> if (IS_ERR(qcadev->bt_en)) { > >>> - dev_warn(&serdev->dev, "failed to acquire enabl= e gpio\n"); > >>> - power_ctrl_enabled =3D false; > >>> + dev_err(&serdev->dev, "failed to acquire enable= gpio\n"); > >>> + return PTR_ERR(qcadev->bt_en); > please think about for QCA2066. if it is returned from here. BT will > not working at all. if you don't return here. i will be working fine > for every BT functionality. > NAK again by me. > Luiz, This in turn is an example of Zijun making a claim that looks like a legitimate review but is simply untrue. He's done it several times. I'm afraid that it may affect your judgment due to the confidence the claims are made with. As Krzysztof said multiple times: the device-tree bindings for QCA2066 are very clear: the enable-gpios property is *required* and so returning an error on failure here is correct. Even changing gpiod_get_optional() to just gpiod_get() would be in line with what the contract in the binding document says. Even if we relaxed the bindings, returning here stil *IS CORRECT* as if the enable-gpios is not defined, GPIOLIB will return NULL and we will NOT return. Bartosz > >>> } > >>> > >>> + if (!qcadev->bt_en) > >>> + power_ctrl_enabled =3D false; > >> > >> This looks duplicated - you already have such check earlier. > >> > > > > It's under a different switch case! > > > > Bartosz >