Received: by 2002:ab2:69cc:0:b0:1fd:c486:4f03 with SMTP id n12csp212582lqp; Tue, 11 Jun 2024 02:04:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXt8ALri+z6S4ynM0235l6oktJGsKNDgP7Ubh4OI+CXPFGBsYgO1m5fhxPfDxlCjLNPOzVbGIosQfGiz6PctGIqye4UjF/tpbiAsfQ2DQ== X-Google-Smtp-Source: AGHT+IHSm/5CY2Ooft8iFfUiZcXiUO4lgkKbu7fLoWOmG+0XnLQxQ3HtP8J6lu4kMzFH1A/oBvfI X-Received: by 2002:a17:906:2dd1:b0:a6f:2253:d1f7 with SMTP id a640c23a62f3a-a6f2253e0b6mr383322866b.61.1718096641356; Tue, 11 Jun 2024 02:04:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718096641; cv=pass; d=google.com; s=arc-20160816; b=SEPLzqpccJffT+7SStYqgx1O6ITXpU9ZStiqYbx6h4CxreMBuWiA7EcPPgYwQ43IG4 QNoT0w8jrsRF80bRT2Er+GAoMiWIaQjRF8VDD7uRCsUqs4ZePlRvnkfoo+q4m+y+BSyt 3ILPtp9KhMmcm6ZpkfOT58xQ8XGyTS9w2dhwEoXSKJnuDt1bIezzz/OV879k8OEQeEbL DpwnyPUlzbQwKz9cev+mv2wuuDKjbDS+y7frE5N3kVFNtJP80F+hMP7oawZ0nGC/YGq3 YyMlVv9hCHMfLteESsqep5UePpuHfkLRgRIF7SQehu0DLlwkEDrZrNhgrv+CHTKjSKCv 5X7A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:content-transfer-encoding:references:in-reply-to:date:cc :to:from:subject:message-id:dkim-signature; bh=MaUvDD1ua4d11/mNYdxEtsIhc9jZ3PvUExTrYcCwUcM=; fh=GksPl483Aaj/KA2uaWW7aZJO0yLqqn275W9OV5j8spo=; b=arywk0SxWzo+ozIKcYjErPwMRV7/6WKlGrr6WDqfnysIDJJ3p91cB5duzUpj+6TPs2 TgGwv63tQtb6QgE3CeKKGBoha+JMVaNzhKaghfpBW4ko7/hv+Gefp1jFhNY/B1KW5jQE V+PF1Gb5TAQaWIRqJx4kaA3QH0ZT8uEfRxw2XTg/AOyEuUbA9Smku44bKD2JnBGVJQ+P 4/HLs8jd7HN8lcwBV/VfX4T78qVgGTqiBb/GIdfgeQ1rO6POfjnvnL5yIFHXF6eMFTPh OW1NuBX8Vka8um4AltIRqNtQ784n19PhCr6XGTmC5bO+mQb5d1aDoinm7T4BL+mKi2tJ yGIw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=RxVxevJJ; 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-209537-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209537-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a6efcdf34f1si354391366b.293.2024.06.11.02.04.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 02:04:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-209537-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=@gmail.com header.s=20230601 header.b=RxVxevJJ; 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-209537-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209537-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 am.mirrors.kernel.org (Postfix) with ESMTPS id B8E211F2549B for ; Tue, 11 Jun 2024 09:03:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DC84C17624A; Tue, 11 Jun 2024 09:03:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="RxVxevJJ" Received: from mail-ej1-f49.google.com (mail-ej1-f49.google.com [209.85.218.49]) (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 8030579C8; Tue, 11 Jun 2024 09:03:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718096606; cv=none; b=owL9/WiSulCqLLUNdhkdL5h7girnNe0GsNV4xsFD48Y7J43UkswWlHUH/UxTOWQf4NHuYk8VDHnIafZT+eRONtGUE+FGZe3z+LnMwacO8hgzU2NpDdJF3tcuR1WxPiJ7l2wp7k4KbuanQibL2oUEOQEQAolAEcxGzm5jBzoxatU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718096606; c=relaxed/simple; bh=cFBtMtud7strLsmIoucBTehp9+ujneQBRiuKV7REWKA=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=WmrBo1Zms8Sg/njjoYh0CSIrbdmCiuDpwSCCnV/7EdV4/BhoPehh5TYQAWNRnAHeXMaOK+igIwzeuCEVB0zNuY2n2u4EJTOI9D12uuvlkQ2cZH+hD7v0qPxt3x8EdtD7gk/sbG1ewku2D9tuSiIFrkPMlEOhqkyHd5xaRgLx4w0= 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=RxVxevJJ; arc=none smtp.client-ip=209.85.218.49 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-ej1-f49.google.com with SMTP id a640c23a62f3a-a6f04afcce1so90319266b.2; Tue, 11 Jun 2024 02:03:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718096603; x=1718701403; darn=vger.kernel.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=MaUvDD1ua4d11/mNYdxEtsIhc9jZ3PvUExTrYcCwUcM=; b=RxVxevJJN8rTcVKZJBYsbqSuJ7hyiDalJGOUlaQRG8vyfCWualWnWLZCZ21IOJ+3DS Xl0XtZtkwDHIMb6BIKK3KhmBGozeDA8IBwtAlEzYtBd02NUBaEYmC+Q5pgBuxUfJY6NP NLv/si02wjTTuN7hc450/LN+4773ZFrF2EnijxSpKKEriC8DL+vkJj7JYZVwP5i3m2kt Bsuzj0ZKENiutJcjBcU5jtBildGT9JZjj949fw9yZdUburWXgXogQhmelgMNgOPMg1IN 2WeBKHAyO/JWXkgiAfCNK2FYpJD6xbVG38rZZiohlc6ayJcas2A0LCo0ggWRoXfY1oND 92Vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718096603; x=1718701403; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=MaUvDD1ua4d11/mNYdxEtsIhc9jZ3PvUExTrYcCwUcM=; b=qk4bQq76iJzw5NE5EKqR0Fw3af8l1DrMVldc4DglQJOxk07VDr0qVF67IXPO78wYrr uzEPU3mYIytwqN7Aelb2/MNAALLqe6UURKSfxlZ9wjPbAV62q4BFOmbf/sEwqzJGQiJO IbUNNlBqhbPUv1TmMjGyQZbgudRc7pDtHv6OY1SByxfWFYwNwMrXa51aTsoklIZ9uLiM rWlSiqdtBvIU0ESgcEjrNW6cfrGPEnAHG51C+ucVRgoIVJgJ9XorD4DKiOCy3jwKnroy M74BNhmd8wjRyWVSabzfEF8nm8jdmDbatbPeanJu/wpLyfTGxi5jABHuJmDvrDm0QrH1 mafQ== X-Forwarded-Encrypted: i=1; AJvYcCX9kl/ZaF9luIqKmnHxF5lWn0CkaKavYdCthw6jXepZVOnEwqFCHgtvYThXWHn5CUUNKipXKXlV3WvFYILN0hk1OEgvBB54FxzGkq3S4lXSzEV8hbGts6l84x/YmztGsmojtI5Q70+gZrg= X-Gm-Message-State: AOJu0YyBnUnoKhrd2fUSj+kz9Qx2QeKX6qYy8ObXpgKjRLYuBgHNPAGg AK3f465GFMv2Y9OB9yx+GZkfcGOm4vBPFAKyUESiLTkdzLLs+S7K X-Received: by 2002:a17:906:3cb:b0:a6f:2e80:6e04 with SMTP id a640c23a62f3a-a6f2e807573mr232587566b.19.1718096602571; Tue, 11 Jun 2024 02:03:22 -0700 (PDT) Received: from ?IPv6:2003:f6:ef1c:c500:994e:fbde:478:1ce1? (p200300f6ef1cc500994efbde04781ce1.dip0.t-ipconnect.de. [2003:f6:ef1c:c500:994e:fbde:478:1ce1]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6e2e1d4cb8sm562848766b.5.2024.06.11.02.03.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 02:03:22 -0700 (PDT) Message-ID: <5f329f81cdfed31771f014d4d3cc35f4d13ffb0e.camel@gmail.com> Subject: Re: [PATCH 4/4] hwmon: (pmbus/max31827) Explain why enum chips must not start with 0 From: Nuno =?ISO-8859-1?Q?S=E1?= To: Guenter Roeck , linux-hwmon@vger.kernel.org Cc: Rob Herring , linux-kernel@vger.kernel.org, Peter Yin , Potin Lai , Daniel Matyas , Andrew Davis , Krzysztof Kozlowski Date: Tue, 11 Jun 2024 11:07:10 +0200 In-Reply-To: <20240610181046.1991436-5-linux@roeck-us.net> References: <20240610181046.1991436-1-linux@roeck-us.net> <20240610181046.1991436-5-linux@roeck-us.net> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.52.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Mon, 2024-06-10 at 11:10 -0700, Guenter Roeck wrote: > If a driver calls device_get_match_data(), the .data pointer in its id > data structures must not be NULL/0 because device_get_match_data() > returns NULL if an entry is not found. Explain that in a comment to avoid > confusion why this is required in this driver but not in other drivers. >=20 > Cc: Daniel Matyas > Signed-off-by: Guenter Roeck > --- Acked-by: Nuno Sa > =C2=A0drivers/hwmon/max31827.c | 5 +++++ > =C2=A01 file changed, 5 insertions(+) >=20 > diff --git a/drivers/hwmon/max31827.c b/drivers/hwmon/max31827.c > index f8a13b30f100..391cb059e94d 100644 > --- a/drivers/hwmon/max31827.c > +++ b/drivers/hwmon/max31827.c > @@ -46,6 +46,11 @@ > =C2=A0#define MAX31827_M_DGR_TO_16_BIT(x) (((x) << 4) / 1000) > =C2=A0#define MAX31827_DEVICE_ENABLE(x) ((x) ? 0xA : 0x0) > =C2=A0 > +/* > + * The enum passed in the .data pointer of struct of_device_id must > + * start with a value !=3D 0 since that is a requirement for using > + * device_get_match_data(). > + */ > =C2=A0enum chips { max31827 =3D 1, max31828, max31829 }; > =C2=A0 > =C2=A0enum max31827_cnv {