Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1603646lqp; Mon, 15 Apr 2024 11:06:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV74nHltWWqpZjWRi+1lnJSh+RHVlf7xByiEJsu7Mvhej4edXEFZJDWtFP+McXfY9WFu5mYDRvpM/1cZXvEWkedlNuzgwO++qaW+HdM+g== X-Google-Smtp-Source: AGHT+IGhtUK7w1PHZOaZmTIFzq9VEiqqOAKL5UGd6WT1yFknLglS7U77B4GeEeouWiSMgbAcNvtq X-Received: by 2002:a17:902:c40a:b0:1e4:24cc:e025 with SMTP id k10-20020a170902c40a00b001e424cce025mr15782234plk.59.1713204370980; Mon, 15 Apr 2024 11:06:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713204370; cv=pass; d=google.com; s=arc-20160816; b=Pu64r4SU9KjTbayiTOflAMDut1YzyUwZ6BXjjADgyJ8Cc1zOF+Drv5aI+FboWJkW0A A0sDGrSpiKIicG6lW9ZR74/XBEFNGc3O1trS/dF7kfznNTxRavFAL6OUwnOvhlIGvFXT aZ9MsPXq1nnh8ruK0bzWWuT3uSBiMBphSbGqXEQVQh3f9SNP1CCqM+BonUnyRNbcGC9p 8indhK26S+2YJrX8v/QcQHjOUyYj4lzxfMVCkyakNlGuhS2bzQq9RV7sJWw8Grf3I/mu RRkc9M0mPysJxXw9QrmuDxx9GUZ2OEnBrB8DY/B681FYAWXo+Yj5Ak2OxT4LAs0j6R6U IDHA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=dkim-signature:content-transfer-encoding:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :in-reply-to:message-id:date:subject:cc:to:from; bh=mSyThA18ConajLRbOxnTiXskFDN8zF2RJ8eodogp9aI=; fh=tE5n859cV0BjUJONcvWuvDBTrbwjawIl47goqTT+08o=; b=Cslbc33Ts0oQCeur0tP/Jfzldyl/HQF59RzBL8h5sm4GCGWFhPVQp5fmM9sFSFxEb9 2PAkYquSC5uqmoPiXq69F5beqDg4bw09ry1HKKAjdi3lBx6DLJwfNoXOQpunAg+JleDu PR87kgMSgUmiMkhfmHYhj0CJHHPzMqVgYnqMfYoB/txItaXzHksCOj9h2VntjCasBcWS P2XaoQBu4xSUkUMIAwMkH/gjcitSG7K4CVsA3gru4XOlHuA60Xnl+6C9zIPX6NBSyY/j yKzhbg2lrAICAzL3S8+FHVP3T1pj0Jev83FhthoCVkpOLnRGHoOhlO6ScS0JP7LPYM5u CVJQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@peacevolution.org header.s=dkim header.b=Wd0IIGb4; arc=pass (i=1 spf=pass spfdomain=peacevolution.org dkim=pass dkdomain=peacevolution.org dmarc=pass fromdomain=peacevolution.org); spf=pass (google.com: domain of linux-kernel+bounces-144317-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-144317-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=peacevolution.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id v4-20020a170903238400b001e4919ed359si8047803plh.642.2024.04.15.11.06.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 11:06:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-144317-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@peacevolution.org header.s=dkim header.b=Wd0IIGb4; arc=pass (i=1 spf=pass spfdomain=peacevolution.org dkim=pass dkdomain=peacevolution.org dmarc=pass fromdomain=peacevolution.org); spf=pass (google.com: domain of linux-kernel+bounces-144317-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-144317-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=peacevolution.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id A0267B21BDF for ; Sun, 14 Apr 2024 17:58:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B46B6135A64; Sun, 14 Apr 2024 17:58:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=peacevolution.org header.i=@peacevolution.org header.b="Wd0IIGb4" Received: from a.peacevolution.org (a.peacevolution.org [206.189.193.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 955CC136987; Sun, 14 Apr 2024 17:57:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=206.189.193.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713117480; cv=none; b=V1LR6XbZT50HDCA+1uUMaBbbzg5gmSqyA2ijzWqck5HMMq9zE5GjxcT3nVuV0TFqsoMgFQhRhelRgBtpXxkTLMMJIB2iGkZnjoOPZnldDcpmE2yqMxydArZezVIvAycKKzoZ6wmoHBh/iRvkAMc/9yULkw+J7RT/HXEQxjSb4XU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713117480; c=relaxed/simple; bh=4J7f19EVJH9G9Gk1UvLU7uM++6o9NhyjBZv3kYWUl54=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=i4Nl7UMgvuQPEc48w1SmWyw4mi3ZQz3KOPg+31Ru4bAlOJTxIraC+2rBbgDSlWc81/IlcE4v0XFfO8Ly+/0C+mJHyrbJsqiMEJjURScnf7TMT6tcOyRRrYCXedGNOPPnrkbqiQ7pZDjniRIZ2f6IzuSH4v6Q90/Ik2mdDBIJZzc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=peacevolution.org; spf=pass smtp.mailfrom=peacevolution.org; dkim=pass (1024-bit key) header.d=peacevolution.org header.i=@peacevolution.org header.b=Wd0IIGb4; arc=none smtp.client-ip=206.189.193.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=peacevolution.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=peacevolution.org Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by a.peacevolution.org (Postfix) with ESMTPA id 93FFB477A3; Sun, 14 Apr 2024 17:57:56 +0000 (UTC) From: Aren Moynihan To: Jonathan Cameron , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Liam Girdwood , Mark Brown Cc: Aren Moynihan , Andy Shevchenko , Ondrej Jirman , =?UTF-8?q?Uwe=20Kleine-K=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 Subject: [PATCH 3/4] iio: light: stk3310: log error if reading the chip id fails Date: Sun, 14 Apr 2024 13:57:15 -0400 Message-ID: <20240414175716.958831-3-aren@peacevolution.org> In-Reply-To: <20240414175716.958831-1-aren@peacevolution.org> References: <20240414175300.956243-1-aren@peacevolution.org> <20240414175716.958831-1-aren@peacevolution.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Authentication-Results: auth=pass smtp.auth=aren@peacevolution.org smtp.mailfrom=aren@peacevolution.org X-Spam-Level: ** X-Spamd-Bar: ++ DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=peacevolution.org; s=dkim; t=1713117477; h=from:subject:date:message-id:to:cc:mime-version:content-transfer-encoding:in-reply-to:references; bh=mSyThA18ConajLRbOxnTiXskFDN8zF2RJ8eodogp9aI=; b=Wd0IIGb4UF+4/RrNlJGIPlj2aYp24AY7lM6c471i2R/h3KubNP+F2SPPos44PXxcVOKZkn 5oWvrEd1gPsGkpKek5sM3J5dg1MFE/GReG8LyEMVwSKIbPhOjidt5Ddnbb6TFIMyRFH2+X JamfRiETlmwufCuwjHaQ3hAbAU5MFNo= 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). Signed-off-by: Aren Moynihan --- drivers/iio/light/stk3310.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/iio/light/stk3310.c b/drivers/iio/light/stk3310.c index bfa090538df7..c0954a63a143 100644 --- a/drivers/iio/light/stk3310.c +++ b/drivers/iio/light/stk3310.c @@ -472,8 +472,10 @@ static int stk3310_init(struct iio_dev *indio_dev) struct i2c_client *client = data->client; ret = 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; + } if (chipid != STK3310_CHIP_ID_VAL && chipid != STK3311_CHIP_ID_VAL && -- 2.44.0