Received: by 2002:ab2:715a:0:b0:1fd:c064:50c with SMTP id l26csp16922lqm; Mon, 10 Jun 2024 11:12:18 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXsR8d1kbu6pCL4/8O6vW8uU28pHt1ao1KWIcT/ilZTSNocO2a6ju3VIwSracHy8qfTUnDxqVNltb9bM6RWZG6GstSxhoIWNZIMG/+Eig== X-Google-Smtp-Source: AGHT+IE/Vm5yhA/ghqfloudCWYSeFiIRP+1J6Unrso1ddBjB4BoJOrAD4Byo5C+3LHVmZ1ir4WGs X-Received: by 2002:a05:6808:2206:b0:3d2:2181:a911 with SMTP id 5614622812f47-3d22181aa7bmr7070404b6e.46.1718043137520; Mon, 10 Jun 2024 11:12:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718043137; cv=pass; d=google.com; s=arc-20160816; b=Vp0LpWuSXe2atHnVdk6xmLOOdVdKzcFYtYC34VG9gU3XW4VTeoOmX+Qdm0qGJR9Id3 vdlWvk+nldIX1pGmnUq90RoucDEE99E5KdRWd3csjG3XaxjpwYLj1PiWiue4fAqiVMab L78xGRdYTTxB4mpDGmLYWrJVuOrfdnAuhtqLbYKRma6Qf9wU8ROEDHuObNPm0xKaFG/m msR5/AEdcTK6qnKK7+GJ/gFo/wYAjNU5w+NE1JWqZwV6nXqLIsC4PyuZeG7spPTu4Orz z4GH+uveYCFTOTRhng0juzHX/TF22niPN+GyEuBuAKNCs2ob3YcWA80hWkoTAYmzXTUP X8dg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:sender:dkim-signature; bh=Ah0Dh0Ya0pvnHgWC+yxqoBec5cmdNc4DrDcokbfP3BU=; fh=9+DeVopbMeQI4Id9YbVIIxfwuPJFApQHQ+5X46Gp5EQ=; b=AG3k6B0MjtNJtr48rQm8vkY5UcySiNeYu0OyZZVoPN4rvhsuFwmb05YCIBdQFEvZv+ c/lTbxoHWHAKWniK5XC1SG26gY0nglCciFJJZViVIKCw/bf8dOLHCjqkb2WjSMQPTevc suXE54awEDIxj+swUAolHqxEmFwF5yYvdio/N//KbUAvka3PRKVDnZODwJVw941cZHKX TDXS7zFks1y0umRapYPdxqqGdSC5gZ8aTMQ8U61lthLCNvCF+COMaZenTLC/Sjfs20HF 8BFYT+zg2lSB9WqmsSosXd5ghT9cmgxcd/7lSB461Ja4jV3o87NF3SUA9KHtVgQwcYBC qLVQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=G0uOp1oR; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-208717-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208717-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id a1e0cc1a2514c-80b98861c50si847860241.11.2024.06.10.11.12.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 11:12:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-208717-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=G0uOp1oR; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-208717-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208717-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 373841C227BB for ; Mon, 10 Jun 2024 18:12:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 15C291509BD; Mon, 10 Jun 2024 18:11:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="G0uOp1oR" Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) (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 DC7AE15098E; Mon, 10 Jun 2024 18:10:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718043060; cv=none; b=SUB2lEaJfP+rSe1lRrlXE3NB0HAiGA7T+8ebpC4O6lZkQZwn5aCgqKIuON99yKnRti9ORf0PS1jKNwQbcqUmMS/R+ehRT55HAwtRrOc/C42RVSX2bhM1wxFkUfe2bsKv7t5Bd48Ehc52NhYzv0cLYb6VVvP9TskDsMwtxacDtgQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718043060; c=relaxed/simple; bh=8TaujMwdgSneCfMTDXBI6ITPwOa00KHwjWVTqUEnIr0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=KvWmNfxGZ6EIKWh/WE4ZZZ0+tLKGqu5PlvuI9OcI2Ylcu6NMH6hgYE2f0KAV1j1cqM+5HGDcMNJewLKtlWSHSJS3u7eDL2iz0NACj2piV6eiqc+YkelDwzSZUmE6WErToU0GCYtmUSJ62bdZHZBjzc6mlDvkkJSGdO4vl/HiPyw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=G0uOp1oR; arc=none smtp.client-ip=209.85.210.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pf1-f177.google.com with SMTP id d2e1a72fcca58-7042ee09f04so1780769b3a.0; Mon, 10 Jun 2024 11:10:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718043058; x=1718647858; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=Ah0Dh0Ya0pvnHgWC+yxqoBec5cmdNc4DrDcokbfP3BU=; b=G0uOp1oR1lCtzYdw40yLqvzsY1W4JN77oTdCK7iQZrgPZtn2ey9GzqLf71NBVS/NkC eJYCB84AXocuxq/Coq57KC6iFaSUARZKz5VsSt2zLD2lPax444/y9K9LVpe232qO1vEw Aw+7aVVwsHwotx13753jc3kutI4RRtgnunOTwIEPXUYgEjwat7O6MuTCv7m4ISt8rXff cDukq8nnk/CWArK24OaI88DfHA70GEi7yJzOamE2oewlMD8k4jhtKOLr4Ph4W2WR4nA1 FgyzI15Kc6428JAxqMmim+bRRY5zSzFVa7/x3yGRn5wUm7VhwIhMPLQEeYnkNe7Zx06G zNmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718043058; x=1718647858; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Ah0Dh0Ya0pvnHgWC+yxqoBec5cmdNc4DrDcokbfP3BU=; b=EcbhyGjtaSVRl6xf95zFWL/SC5a8S2GSeRlvnKdOnQdXoMhLjlduJB/sMdYrV4PfNB yEJM530DlGsEXM+un8OlTANe1IS28QjS0j+4TXtxM8vdcYCuAJjlVzxIS9Dn0/jn/6eU erIaPKwTQDvFSfeusXO/Zz+I8A8RyqvrQibTsq/zyBfKkzb83VZ3Tsi2d5IJWpJT/G8b 0kohJuT8CCg67KxWo+P7MIgxX83yi//so/GSeTVW3+5nUqByyhpqS+P+AWxKx8llX90C URf/S9U9+J97gfb0Zqp0F3+paMSGaxOUqQPo+lVoVj6vDkyRzh+bV2Asg9nyamA6se64 mILQ== X-Forwarded-Encrypted: i=1; AJvYcCXXEaw+/dku84AUVpugUj+Zb+iZbhnD9UyjlSAwCcsa4bOqaUMLn7ft6QFdp41IRuCNK/rNYTZG0QUBsgnEzxq/UnrMHPWUAtsMi0aW X-Gm-Message-State: AOJu0YyX36mF7GNlSmWJqtErmZ0KyVa4N/DDk3S4D8yxaYhMBe0vhszU oog+0JcncFLM677AKnw2AUIuP8ys/SKwFduHgN/gMKEXhA7ZsUgUVWYYRw== X-Received: by 2002:a05:6a21:3a86:b0:1b5:ac9b:a59e with SMTP id adf61e73a8af0-1b5ac9ba77bmr7352956637.32.1718043057716; Mon, 10 Jun 2024 11:10:57 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-70414a801besm5489914b3a.126.2024.06.10.11.10.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 11:10:57 -0700 (PDT) Sender: Guenter Roeck From: Guenter Roeck To: linux-hwmon@vger.kernel.org Cc: Rob Herring , linux-kernel@vger.kernel.org, Peter Yin , Potin Lai , Daniel Matyas , Andrew Davis , Krzysztof Kozlowski , Guenter Roeck Subject: [PATCH 4/4] hwmon: (pmbus/max31827) Explain why enum chips must not start with 0 Date: Mon, 10 Jun 2024 11:10:46 -0700 Message-Id: <20240610181046.1991436-5-linux@roeck-us.net> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240610181046.1991436-1-linux@roeck-us.net> References: <20240610181046.1991436-1-linux@roeck-us.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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. Cc: Daniel Matyas Signed-off-by: Guenter Roeck --- drivers/hwmon/max31827.c | 5 +++++ 1 file changed, 5 insertions(+) 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 @@ #define MAX31827_M_DGR_TO_16_BIT(x) (((x) << 4) / 1000) #define MAX31827_DEVICE_ENABLE(x) ((x) ? 0xA : 0x0) +/* + * The enum passed in the .data pointer of struct of_device_id must + * start with a value != 0 since that is a requirement for using + * device_get_match_data(). + */ enum chips { max31827 = 1, max31828, max31829 }; enum max31827_cnv { -- 2.39.2