From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lj1-f171.google.com (mail-lj1-f171.google.com [209.85.208.171]) (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 B7439824A3 for ; Tue, 16 Sep 2025 08:14:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758010450; cv=none; b=COaM42AFQLbRloct8bGEW5WpgFRhbZZyd+1PCrKGPTv3uKA6Codx9bty1I2WPPaqJPg5j5uDrElKNgTrm1q5xqZGE0/3gNngj00L2XDKtehhyS3Cb4thjwSR2iQT7Kv55iHNHk9+C62pA7eABKzOxe2+HM1zlepbWK+lkmQwp0M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758010450; c=relaxed/simple; bh=OkRn3wi3vVLwlm/wDKzvfBew8i5CbraIcmJaOETj/3s=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=PCp9AWoFge+feH02dSOfH2vTqaw4HPiEXzMQaZon/4qQ4XV60qs8pjYCrpfDyLA6ffp8UbwSdhgEYLIGuJtsESjPfH9o/nbBKDnfUF61ee7Gl0dqTsIlT/4XRUxW+EFX1YftdcDy3cUzIsgQYErdcjYqmaaeW52tsax4fhRPUqw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=QjNyl9ex; arc=none smtp.client-ip=209.85.208.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="QjNyl9ex" Received: by mail-lj1-f171.google.com with SMTP id 38308e7fff4ca-336b88c5362so52071551fa.0 for ; Tue, 16 Sep 2025 01:14:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1758010447; x=1758615247; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=jM7l65ARIgofwE06qZfm8EVMSCpb/5Bo5xaYN803ql8=; b=QjNyl9exinOXW2DeNKK2qEYSQo658maKc2gFnzV5hAynCMuw//y5r1Yp2TBHvlxmwn V1znYPL5cITxV1yJFBq5G8ZyVgKgXk5AI8JgYjCcdpyH2YinFjDx2XI+/W7ise6W6BOx KWz/+MevUNH02LbBC2mM5dXIM+C9eAIbh+Hg7rScT6z31a2vWgZLSvo6Eip2hO4Nwdux TE68w30keWAB2cFkrAjUkf2CRmPZJJ+FUDbHhCryO3OZn+0Kq7Ompg07WC3I3Br2oLPT fmyOY5Og15HbYur3DirQsNhvYRovbPj1YVAHUF5qEGU79+3C9yG/eixc0pWANoLJRNrY 7hUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758010447; x=1758615247; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=jM7l65ARIgofwE06qZfm8EVMSCpb/5Bo5xaYN803ql8=; b=I+aZIptNTgMUW2MtFp+cTRRVNhKlzK9ODmMBr1wh4nSrTaJ7sz6QIWVPpqYk9IHsRk 4/nMZi8bjGfLwMfhuFxFNSl4ybCyu3YaDpppR4zCjebBR+TZt/bP0PSKLE63uoC4Ndt9 +YcfNKRXfM9awfZ1OIL+8t3O+RBGCw9e8UN1cJ6nGAyv9qMf3rwS9aKyMmDl0W+vNqP2 vAWseql0P+hlM06puP8n81ytGgTUKe31TaJnCxWBVClrBW+DVMBm3fYksdiFOG68WEDL JfYf4hct83iJbZhcPl5j9E3HbwMVtAoU8UxmKUbIsNTpF+HYmV+GKI4AQRwwvYTvzPFs Sg0g== X-Forwarded-Encrypted: i=1; AJvYcCXetktGheK+dPEeUid/Z2zhIfBI0PfTHPUUbYWjA9YsLfcpIjc6k1VF/BlIoEd2+35VDtMc4cBJ+XXq@vger.kernel.org X-Gm-Message-State: AOJu0YyTjtODHyIYGzivrkpStQVqFZyBYbO73k4FpOgi2MApHjsWowek zTa0rpcGEzqdnMCu3ERQaUFMg0nZCATJCWNiqmOXnt33T0RAQJoZHmQ9 X-Gm-Gg: ASbGncvV052T5kJyvC8S2pDrfCEgfjIZlUTj76JRt4C+U3gFp2svi1jn+eC9WeGO0+i 8HF9ms78CfdNTV3Lz3mbXs5rWMjCF7/GVDMink5GtsGYB7ule2FmdjM8PO+i1hNSwJYkFw7oZCx 8KUcInBJioTCoejDGNJj77ViI1Ou2rzkClCVduc3tb4Ewx3rvcM84W3HHb11J3PgDG0fBa+hzQN p07dTzupc/ba0SSVy4tQPsSQHGSrQKYYaK0zTeGSr8mSHnN+NF8/WraGWyqSrfAwk0MOBONE440 U1sKYRUvY3eDQqICyYtkraGS3l8rJe2jYtBgzqFOCHETO661WZ0oO2WhEUPoUrK9ZmNA296x4Vn MLpDe0cpthhzZ4VGJAvVgDSBNW2T3b5BIzOXUK0Pxwq/1/KmLx2UXUebSTV7tJGH9/fwr+Y5NtF z9TrCo X-Google-Smtp-Source: AGHT+IEJVE0MZfILx6PWce4nwraMO2Nm8lxid/SAnbgN3RqRMuFMYn2p9OaYKJPnb6fEuEss67LUxw== X-Received: by 2002:a2e:a016:0:20b0:336:7e31:6708 with SMTP id 38308e7fff4ca-351403eccb1mr36499181fa.37.1758010446711; Tue, 16 Sep 2025 01:14:06 -0700 (PDT) Received: from ?IPV6:2a10:a5c0:800d:dd00:8fdf:935a:2c85:d703? ([2a10:a5c0:800d:dd00:8fdf:935a:2c85:d703]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-34f163f495esm31002351fa.24.2025.09.16.01.14.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 16 Sep 2025 01:14:06 -0700 (PDT) Message-ID: <14d3dc56-c6cf-464a-9a57-2a7a6afe8af9@gmail.com> Date: Tue, 16 Sep 2025 11:14:05 +0300 Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 2/3] iio: adc: Support ROHM BD79112 ADC/GPIO To: Jonathan Cameron Cc: Andy Shevchenko , David Lechner , =?UTF-8?Q?Nuno_S=C3=A1?= , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Linus Walleij , Bartosz Golaszewski , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org References: <20250915-bd79112-v5-0-a74e011a0560@gmail.com> <20250915-bd79112-v5-2-a74e011a0560@gmail.com> <20250915211321.47865d3d@jic23-huawei> <20250916090206.02f601be@jic23-huawei> Content-Language: en-US, en-AU, en-GB, en-BW From: Matti Vaittinen In-Reply-To: <20250916090206.02f601be@jic23-huawei> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 16/09/2025 11:02, Jonathan Cameron wrote: > On Tue, 16 Sep 2025 07:52:07 +0300 > Matti Vaittinen wrote: > >> On 15/09/2025 23:13, Jonathan Cameron wrote: >>> On Mon, 15 Sep 2025 17:12:34 +0300 >>> Andy Shevchenko wrote: >>> >>>> On Mon, Sep 15, 2025 at 10:12:43AM +0300, Matti Vaittinen wrote: >>> --- a/drivers/iio/adc/rohm-bd79112.c >>> +++ b/drivers/iio/adc/rohm-bd79112.c >>> @@ -454,12 +454,18 @@ static int bd79112_probe(struct spi_device *spi) >>> data->read_xfer[1].rx_buf = &data->read_rx; >>> data->read_xfer[1].len = sizeof(data->read_rx); >>> spi_message_init_with_transfers(&data->read_msg, data->read_xfer, 2); >>> - devm_spi_optimize_message(dev, spi, &data->read_msg); >>> + ret = devm_spi_optimize_message(dev, spi, &data->read_msg); >>> + if (ret < 0) >>> + return dev_err_probe(dev, ret, >>> + "Failed to optimize SPI read message\n"); >>> >> >> I am not really sure under what conditions the >> devm_spi_optimize_message() could fail. It might be enough to print a >> warning and proceed, but I don't think returning is a problem either. > > No. Don't proceed on an unexpected failure whatever it is. That's > storing up problems that may surface in a weird way later that is much > harder to debug. Just a generic note, not disagreeing in this case. I have had similar discussions before - and I have been on the both sides of the table. Hence, I don't have as strong stance on this as you. On some situations it is better to just try proceeding as aborting the operation brings no sane corrective actions but just reduces a device unusable. On the other hand, as you say, usually bailing out loud and early is the best way to pinpoint the problem and get things fixed. I still think that logging a warning should be a decent hint for someone doing the debugging. Well, as I said, returning here is Ok for me - thanks for taking care of it! :) Yours, -- Matti