Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1502159lqp; Mon, 15 Apr 2024 08:14:55 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVHIOGpZeFOPiPv619zdvBZPg5tx+aCBCY//cuXl9eCvFXLdFnq78SaAzuKNDwz0j4P0BR9uhqNn1k7ZcapU7Ofk7Sh9qIR716RK8DkFg== X-Google-Smtp-Source: AGHT+IHoPaIPb67wRmf5loSm17pDv9S5X0VN2N9UWLM2w2ugvtrA8fyJIKtXLfj3daZ22tv7BMg9 X-Received: by 2002:a05:6a21:996:b0:1a7:528b:33c0 with SMTP id li22-20020a056a21099600b001a7528b33c0mr9007241pzb.33.1713194095038; Mon, 15 Apr 2024 08:14:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713194095; cv=pass; d=google.com; s=arc-20160816; b=Vzir6F4mnrmOVpc/h8kySwPE6yBajeROQ+dOf6H3d6J/MGpx0wEtJgHMFIWfnYWOif xRSqqY8lsqxtuqVBiDhKa8itBJVP1O22yEeX+o7JRK7A5m9HBASckaYtM56ru6puV2J4 Ns3ZT4ZyrTiJsp91DUtr7TlZXMPNQUcIWsjjpurbFi0V8tYC8b5bUf8thBocnGIgZP0+ F5JRmXWW8jkBdbwLCS/EatorumpUdh1vcdxa2p3LSiC0/9O7Qc0nen+aJ1vmBFlbdxep Ay47SfYiPcE2greyosnrScJJa/H95k4wVZFPCcfWQFV88AF7JAAzhRodq0StwZfvPi+i stfg== 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=/7/TBRaaPIPtSJDv4IMqFEGZB5oTZKPTNBkY3AEKti8=; fh=oECOWxdnf7ZQOgxoye+imfHM8PrQzKnvrPPFu7WxVmw=; b=wVW+Bkc3GSsxclkiC0A3QSl07D7+1WilcZpZVkeRxwLKtADVBfTfCbM8fjaSL3j7zA uGWPfzG4LSvdxQ6dO9mPvf91uyYXSEVzMXQyxrqJRQMzIfVZtOeF1Rketb7W7l+FA7m7 lmKC4uKm91JSvfUQowdltyzYamewYPyuTh037RNBaKogUHkSCgAg4xJJgpJko00newRv NBr8bEsJC0sWAn0Ka+25s/kUXN3Mnf8jwxeKkFjfGlljGDpnKbZ2gtOLlzaPiB4NPSFP hiD/w8KRjGY5e9EjiJVRM5lEtdldJZ1tbz+/oAYMiI1TU8Gp9fGovt369qrbFuwh6dhG 05gA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=KM0BZX19; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-145425-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145425-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id i186-20020a62c1c3000000b006e6b30a7ec6si8023869pfg.231.2024.04.15.08.14.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 08:14:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-145425-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=KM0BZX19; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-145425-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145425-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 16203B23933 for ; Mon, 15 Apr 2024 15:07:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 63D8C78C90; Mon, 15 Apr 2024 15:06:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KM0BZX19" Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) (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 859647868B; Mon, 15 Apr 2024 15:06:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713193595; cv=none; b=smx8QKElwYy5/Ydymw5iwp9NqW5AFR9ZHzygl1OyeLOVDqTq2tj/5UpKAZOedK3qIjzc66/S0ha2e3C53xOOIqG7BGrdN/vkLDUIjdlCriEGXZiJdTGHt5PwTwrCtYT8suYcND+4iQnPR6og3Cb+uijiE7h1zZ2bFwkbyU79ihE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713193595; c=relaxed/simple; bh=mOsRfd5qxASFakmIqOXVcTvu3CyoQSRnAIxxp1fG+4M=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=RDr0mPcaMr+zxVk+MhpptPOwTmCzssUF7wSa0ALqksHI0wGkPyoAHO7Jh4L5BF6bNE2eJT5Wmpqql/TAzZWKA9srOuM/DSKTlmFGaY5eI+zt03oSjDNGTI7ctVMP38YszsyArDN6KJIccnYKO+0UB3cN2V+ShKyVmGj9lkeS7RM= 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=KM0BZX19; arc=none smtp.client-ip=209.85.208.53 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 Received: by mail-ed1-f53.google.com with SMTP id 4fb4d7f45d1cf-57030fa7381so909037a12.2; Mon, 15 Apr 2024 08:06:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713193591; x=1713798391; 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=/7/TBRaaPIPtSJDv4IMqFEGZB5oTZKPTNBkY3AEKti8=; b=KM0BZX19UxPfb4hlyvh/+Af4ZaDBBqk/VAOe8/s95nEk8NnQ76cfVv54IaY8Z+FEdV RX2nPssJELFeQffCg3sUbkeNIKbEnIOdJvA3OTtpIcSbZBEA0F4bwHUd4sU7m0DPCV60 YPOGzI06wBjWtyQqpJ+xptXMMvj443kUwZNgwZtwjxcIO7yXlxfw/BCTyLSsPi/AelMw aupciKDdAJf0XuysYlJbzI9tUIRsfa9DGjELCG96+pvoBJTjRRrpfd59aSP2iH1B3vrz L2/Pbf4vXffPD9dDRCUB2QWnX+7L7ZcxJ4s422t77tPKM2Q1VZKhWq1sJ3jcTOuZmvLa t4qA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713193591; x=1713798391; 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=/7/TBRaaPIPtSJDv4IMqFEGZB5oTZKPTNBkY3AEKti8=; b=iWOrGgo2DGPPc+sOZs3eLY+8Y4GMxl0rh9KU57HOlzX5Ma/EiJrxq4RdJezmr6DE5t WYPa85upKK/HRHXR8FXZJ3jR9AyG8JQCsCKtrPp8cewXOnXbVDepVFYNuer/Jmes1uVi f7pVFyckCqnaYOlQnf/X3pumoaKFm8IyWt1bObU67YRnvD9VW8kQTTCxcLz5yqTJdT1d MHWQSNLk2p7vY9SVc5JuwriIOHzD3m1o/10vEJu0ts97r+gzrzlwYqLJF+KsT6mqCnAT PIWcMq4/alMAb3G4nxH2FRovMqtHTxuHkIDeXeXiOnlKXZVCaqJaFmg7AjJ3VPK9iUzZ qELQ== X-Forwarded-Encrypted: i=1; AJvYcCWK5d9dywDQtGdZiO1uB4QsqnzeP/tvdfYLPtF5xKMHB2t4o7CISRFrInL+P1QZzM0tfZUbdmnp5YTU9saGwKcX3Q4GNVtdOrNwpCZm8GaMS+qD2bfKOKBrLcDge2CxszTlVWJoH1AVLuSo4VCaG16XCm9GnJdmMZ6fAsirNbrqJeoNqNTh8DkChsCXbmZk6uv1lufMVa4mYarQivPuiAQ3 X-Gm-Message-State: AOJu0Ywuz7zv2xgMUkTWdH4yyJkDbNOgk3Oj1dla8U+vKicCvuaLlM+5 h5e9YPdu84VL7Q8J2KwMhW9KATrwXtJDKYc5rg4EmAoNqaFZ9zrOG1oQ6mLeA5rou5UECCwu4bS y2JenBUjY4oawZUvIYfNuzjE1HI0= X-Received: by 2002:a17:906:3fc9:b0:a51:f915:bf5a with SMTP id k9-20020a1709063fc900b00a51f915bf5amr5280873ejj.75.1713193590873; Mon, 15 Apr 2024 08:06:30 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240414175300.956243-1-aren@peacevolution.org> <20240414175716.958831-1-aren@peacevolution.org> <20240414175716.958831-3-aren@peacevolution.org> In-Reply-To: <20240414175716.958831-3-aren@peacevolution.org> From: Andy Shevchenko Date: Mon, 15 Apr 2024 18:05:54 +0300 Message-ID: Subject: Re: [PATCH 3/4] iio: light: stk3310: log error if reading the chip id fails To: Aren Moynihan Cc: Jonathan Cameron , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Liam Girdwood , Mark Brown , Ondrej Jirman , =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= , linux-iio@vger.kernel.org, phone-devel@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, Willow Barraco Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, Apr 14, 2024 at 8:57=E2=80=AFPM Aren Moynihan wrote: > > If the chip isn't powered, this call is likely to return an error. > Without a log here the driver will silently fail to probe. Common errors > are ENXIO (when the chip isn't powered) and ETIMEDOUT (when the i2c bus > isn't powered). > ret =3D regmap_read(data->regmap, STK3310_REG_ID, &chipid); > - if (ret < 0) > + if (ret < 0) { > + dev_err(&client->dev, "failed to read chip id: %d", ret); > return ret; > + } Briefly looking at the code it seems that this one is strictly part of the probe phase, which means we may use return dev_err_probe(...); pattern. Yet, you may add another patch to clean up all of them: _probe(), _init(), _regmap_init() to use the same pattern everywhere. --=20 With Best Regards, Andy Shevchenko