From patchwork Sun Feb 25 20:16:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 206111 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp1729675dyb; Sun, 25 Feb 2024 12:17:20 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXLFtx9wpVa+LFB1mDSvW8gI4sOVrczuKG84vCNpS79/8Pw1IUWr1GtGUR+o3MCQTKzZgI3jCIEpmR+pSI2R/Sfg8o+nQ== X-Google-Smtp-Source: AGHT+IH/mqKZdeBeAGTc1vSLEEpDPXaAZ3BhejLK8AyXxTPBKXzPCU1K1feWfKekcP4k1GAhYpOW X-Received: by 2002:a05:620a:808:b0:787:702a:1411 with SMTP id s8-20020a05620a080800b00787702a1411mr8880245qks.18.1708892239900; Sun, 25 Feb 2024 12:17:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708892239; cv=pass; d=google.com; s=arc-20160816; b=mpyAR1xWGXCN3xlY7q9WvjHxQqMZfY/ZmpVo3CGlnSzJa6LTVlbTNYQew/Xy1WcziC 9j18WhCRL9uBx6dfF964teKq0YPzT7l4VL13Mpw/S6Z+9jGunL5qgZjTlKDfH7BoX1um GGf0qjZ39rdL2JRFdp0ROeEBRZ0vlpT842QjB2wTQs3pffcQds+h9JgdBq2wCLCfR8ot bqoIi9PuDW0H5+nLIVc7JAmD0D2kkFSZcMSYlm/mI1BhlZ3y2dx0kyX/IeMuHzQRse5U /RpvOukltfqACwm8IqtDaujnkdCF58LaixKC/NW48Yen2ZrVYuV2QbWlqct3k+CnW4gZ 3c3g== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=g0BL3CAb54Q9PTk8ioTJQE7FsRhBBa8lLja7tu/HP78=; fh=EVoScH1K4ZW3X7S855yUrox9y/fNS+vD0OKDdKtvWXg=; b=F34FW0vhtNVIhvbMkBLOPUxh54Q9X1uTHgkprsWaPDyCnFkWh8G3BYvpz5VHZd0pJU q+ptAbsaKwj8PMK4WEBs/BtLz0OrfquymsbUCWTSeWRmSqgT8o9Ht/oHn8hFrYFEm8gf 47wVJf4dQ7MxeuXPzPb+JOl2adUgi4LeKhJQyRQhUOSa7FMIiSwcnyKbV/OionyKK3uP ikOfurpD4XTPkWPJHr/DVsfsgIIU2ZOtk1Bu/TpGuW65pX760+XAo3U0Grf5dnHHzXCQ hTFwFdWdLQSnQfRlX8TcnMN6J4dIgmXdYKJWXY8aE52vz6Os4xh0BXdqoSHSrVksn3G9 XyAA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=f5vSG4qX; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-80272-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80272-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id v18-20020a05620a123200b007876a5b2236si3740551qkj.457.2024.02.25.12.17.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 12:17:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-80272-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=f5vSG4qX; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-80272-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80272-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.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 9EE281C217A4 for ; Sun, 25 Feb 2024 20:17:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 819DC1BC26; Sun, 25 Feb 2024 20:17:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="f5vSG4qX" Received: from mail-ed1-f50.google.com (mail-ed1-f50.google.com [209.85.208.50]) (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 B9AD81B94A for ; Sun, 25 Feb 2024 20:16:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708892220; cv=none; b=EpI3FubBARiFHDwoEcx409HNkmVkqdP60lKhsxaU8PLbW4eF8hcChdyau7/9RzITlVfp8i5YU8yzk34DmO8NnRQJG9Xso5xT4hJrj1syaFKfI9hIkNHFQbhCe2YqowcOFOIidLaBoiLEEUjMVh6ureDyYnrgv3ZL8HSoqJWJCq8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708892220; c=relaxed/simple; bh=VxLZ7RsZpLYYQuSI66FP3nhHczQ7j/5oRGLYsnKLyxA=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=HCDxdeZBuwuBuUpGDsvYpFZtzkuDNiltLvdtNVF+OfIGmZxUjqjvZCDsXhtNB2PsD7UXVPPu6bQk6UvEzeIOmzR7Y3efGY8FEw3DCb7w5aOLsU2IJDNSaKc0eSt3W8NnGfVoyzENXkLPbS3FEtbR91LExpx4NdLhHBp92DVzElU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=f5vSG4qX; arc=none smtp.client-ip=209.85.208.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ed1-f50.google.com with SMTP id 4fb4d7f45d1cf-563c403719cso2887415a12.2 for ; Sun, 25 Feb 2024 12:16:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708892217; x=1709497017; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=g0BL3CAb54Q9PTk8ioTJQE7FsRhBBa8lLja7tu/HP78=; b=f5vSG4qXd9pUCvhlxp9v/GNYyIsxtY0mIpf+5wDoVjNO0xmTJL8Ll71Xur6TdQsWOa w3/KV52CoI9ubi2RVgOI2fgfRuhm3VJo3tJc1lbmkymcqpWzMPTVOYyYtXWeL4n+G2/S eGeaLoZdF7Z6xoHbfUVbe8HdwEE3Iz18vE0gIWuanYnVDgzIqTuIKkgT8EQYTkYFjuKy Y/PyH69ZQJix5qFnMZYmuNN0mZteKNVOsDIVZzBlpkHlKJrsbVzrTVjbB5vuyP0LNJ5q 726cAKZNiZve9zoNktBU7BwX/jIqJc8dTbJ7Resu/8dc/iStWP8dNaNjmbSvS7DFOUMH bKZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708892217; x=1709497017; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=g0BL3CAb54Q9PTk8ioTJQE7FsRhBBa8lLja7tu/HP78=; b=MoPSHaMDAuavwlmuZd46QWGlC7KIsbzltoz12UaVAJjF64YiHFG4RAzg624KFXye38 Ra0xjtZYnlxgQOMZshVXb6jueFb1dBJye+uqRqIEpVzWFitxxnp12twKJpi+TxLylBJ/ RIM/ZBySHrBRAWLbSDHn0oxVOAlEMQGKk5O34AqU8WTyr80DPDRFYKBpoCe5p+Hyu8Kw zCT02m7AJBLr8EHFIo4QHGjMBRb9xyFfiBQJ/DRf3fLuVazsBfXGTy8vPE0u7iayAiEw +57mAXtqyMU/rEEbxmSI50gM0/qIZycTz+gc+IBMyGWNnJrmu4fWqRdQ/jWuj7DwH66D owXQ== X-Forwarded-Encrypted: i=1; AJvYcCVNdAq1P2dhrhq992MbbGiNMT+uASrVlLzqF1lNIY1nQeBpS9pSlvtV86T916g7qF0W39K7+EzYX6cLHETFscGslNuRftjsUQOeHRft X-Gm-Message-State: AOJu0Yw0UgWgylct82rwaYsy3TkJDOUwfgeMirTiPuV8tHHwrLtUr5eL 1pLznb8JFP7u4G+kiJII5pPLSqSoRqNo86NxxsFSrv+1yQOVi41TQk/oyD4AWuk= X-Received: by 2002:a17:906:f804:b0:a3f:c0bd:b7bd with SMTP id kh4-20020a170906f80400b00a3fc0bdb7bdmr3933047ejb.43.1708892217056; Sun, 25 Feb 2024 12:16:57 -0800 (PST) Received: from krzk-bin.. ([178.197.222.116]) by smtp.gmail.com with ESMTPSA id ck13-20020a170906c44d00b00a3d7bcfb9a1sm1741045ejb.128.2024.02.25.12.16.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 12:16:56 -0800 (PST) From: Krzysztof Kozlowski To: Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Cc: Krzysztof Kozlowski Subject: [PATCH v2 1/2] iio: dac: ad5755: make use of of_device_id table Date: Sun, 25 Feb 2024 21:16:53 +0100 Message-Id: <20240225201654.49450-1-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791903389627277011 X-GMAIL-MSGID: 1791903389627277011 Populate the of_device_id table with match data, reference it in the spi_driver struct and use spi_get_device_match_data() to perform the type matching to fix warning: ad5755.c:866:34: error: unused variable 'ad5755_of_match' [-Werror,-Wunused-const-variable] This is also preferred way of matching device variants, then relying on fallback via spi_device_id. Signed-off-by: Krzysztof Kozlowski --- Rework according to comments. An old v1: https://lore.kernel.org/all/20230810111933.205619-1-krzysztof.kozlowski@linaro.org/ --- drivers/iio/dac/ad5755.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/iio/dac/ad5755.c b/drivers/iio/dac/ad5755.c index 404865e35460..877c1125d892 100644 --- a/drivers/iio/dac/ad5755.c +++ b/drivers/iio/dac/ad5755.c @@ -809,7 +809,7 @@ static struct ad5755_platform_data *ad5755_parse_fw(struct device *dev) static int ad5755_probe(struct spi_device *spi) { - enum ad5755_type type = spi_get_device_id(spi)->driver_data; + enum ad5755_type type = (kernel_ulong_t)spi_get_device_match_data(spi); const struct ad5755_platform_data *pdata; struct iio_dev *indio_dev; struct ad5755_state *st; @@ -864,11 +864,11 @@ static const struct spi_device_id ad5755_id[] = { MODULE_DEVICE_TABLE(spi, ad5755_id); static const struct of_device_id ad5755_of_match[] = { - { .compatible = "adi,ad5755" }, - { .compatible = "adi,ad5755-1" }, - { .compatible = "adi,ad5757" }, - { .compatible = "adi,ad5735" }, - { .compatible = "adi,ad5737" }, + { .compatible = "adi,ad5755", (void *)ID_AD5755 }, + { .compatible = "adi,ad5755-1", (void *)ID_AD5755 }, + { .compatible = "adi,ad5757", (void *)ID_AD5757 }, + { .compatible = "adi,ad5735", (void *)ID_AD5735 }, + { .compatible = "adi,ad5737", (void *)ID_AD5737 }, { } }; MODULE_DEVICE_TABLE(of, ad5755_of_match); @@ -876,6 +876,7 @@ MODULE_DEVICE_TABLE(of, ad5755_of_match); static struct spi_driver ad5755_driver = { .driver = { .name = "ad5755", + .of_match_table = ad5755_of_match, }, .probe = ad5755_probe, .id_table = ad5755_id, From patchwork Sun Feb 25 20:16:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 206112 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp1729704dyb; Sun, 25 Feb 2024 12:17:27 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUpOBb5cfghWooY7GpYA23N/cLrlfcMGLacosDYt/pX1m7acuB0t0VJTdWfDH8xXcc9oKrUCOEo7TYxmEpS4mboinKDEQ== X-Google-Smtp-Source: AGHT+IGWdC/EghDNOkZjL0tQ9vj3MA3CaunFEER5mSqw3xQ7+kKAJY5nPvDoZvuTeCSzRnUlKCHT X-Received: by 2002:a17:906:69c8:b0:a41:5675:4e2e with SMTP id g8-20020a17090669c800b00a4156754e2emr4702446ejs.19.1708892246886; Sun, 25 Feb 2024 12:17:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708892246; cv=pass; d=google.com; s=arc-20160816; b=lV10MJFSUDvig5IxoQfg8YO6tmvSwzHS/NCi0f26VHyv258uXncWCrHlV/VZZSOK3G AqpkFq9tRjnv29Czb3yDCMUU9EYBSxU2qKFSEqA53q19syrr+cL426B2flpmCKwMBQT6 B3AEovMkE0CPTX4VKTG9mPOlNfMwY7ixsMLraYfEXtvG6+0b0mtDDMWlyslkjCqKZXZ2 6G4CHS43IULdu0z87Q8KRtq9Qi7ZZYPEJcDgDC+EJ/zNS08j+l3qBb5zjvX8lkYMxH3M Mq43olaMS9xo7qy9fj0xHV+x9CkLsir0Hqoc1KODDvEtgzjTKLXCfomUsJMaRuWIZ+Ap 46ww== 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:dkim-signature; bh=6RDTCOuw+4/YmutiadjBWbj6E1uINYYJEFoH23miprM=; fh=Zql+qn7Yg7n3QPt3pHE2aBp4hVVbEZbyHNRPYjrvXjo=; b=OKOuMZ87iRoVmkCsBfX2DnA5R4F1uw4/4SH9qUkXnYMIsaZFKAMQai5WgdC2nFQ5nO 5+wGCms73TXfXaOICcHGMPQ4gp5X4fNvSM2kDsrKwmfL9PeBIOWdAwOiAD2m40DYE6TU ezbynfl5KWbtMf+IHURRQ7wKb5R3rc9Ow35xIRcUUXTlzlGuDWciugzL2vhTMZtVETcB ViKZu0FHWZ31uSarbWcYN4a3NxQH/I5RBLvFYFU9k/NcRwGl8gvSDDu/+VkIYzWdnuvi EhzG0WDDekmNhVFavuQfWMrhHWeB4ilaGz/hPLnZE0If4VMp1cKISLjGPYf6eOMCN8SG UCfQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jTSc2LUl; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-80273-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80273-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id me17-20020a170906aed100b00a435b6d553esi75361ejb.283.2024.02.25.12.17.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 12:17:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-80273-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jTSc2LUl; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-80273-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80273-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 5E4691F224F6 for ; Sun, 25 Feb 2024 20:17:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 64A661BC4D; Sun, 25 Feb 2024 20:17:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="jTSc2LUl" Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) (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 1CE971B94E for ; Sun, 25 Feb 2024 20:16:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708892221; cv=none; b=BVLsjC2bZFFScqI2DMihrez9uNMyo+5iKuWuj2caBPKVtre7iLxKNru+9yXVTnHs2Gx7q/P4Tx3CCs4LPQ1O3pgt6vgaYDZVQIK+i4h7CEA86gBNsiAgtn2y5G1g8cqVr7YCmn56SFAhPG7WF9bExSL7sgGAYCRgSuvbVCIVkWI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708892221; c=relaxed/simple; bh=hYVGG3zCAp5q9wfPxfygwzoMeHDq1lD0TOw/nA3SQqQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Nf+t7ch3aXJ3tTSpIu1lulPVBNlImvGzfwTPLuJmY3RBrcjylqCpGc2znCG720pI17tdEmaRCXVAJ4wFUKkRVJIkp9toFNAd2GaPzDp7/hN+8hWe+OyXbQgYLQDeSulkpiruViitOQiFSis7J9MGyqpiLsiIw5xHW/7b7cUzq6Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=jTSc2LUl; arc=none smtp.client-ip=209.85.218.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-a3e75e30d36so473536866b.1 for ; Sun, 25 Feb 2024 12:16:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708892218; x=1709497018; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=6RDTCOuw+4/YmutiadjBWbj6E1uINYYJEFoH23miprM=; b=jTSc2LUlfL9HNZQxdkHaTC4xuPsQJARzz3Z4OQYdm6h9WFT+s78aJ9mxdKQykCf/mm a003kjvKslqH6b+R0LviKWzJzmmvx5Kgc+UwzeFfkxLyS/wlTt/Drk0pf+pslbLlMo/0 lFM75bX//fGjirj6usSAZM3DWQhHl2FDxs1v0VjdHKjMM3yhR8s61MIQ4IfEEuspG+kn tuZsstHtpvfeCYJ81KjrSWQbEo+iLLwPkBM8SY4RGISq7G45PB4aJ0dFxzzQjpcyf8Lc lENV1ZEe2CAfaqHqr78qUuJCDD788KCzdWqNcZroxggMT7SXZ/A0x1roGY33Nu5Aa97n PDlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708892218; x=1709497018; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6RDTCOuw+4/YmutiadjBWbj6E1uINYYJEFoH23miprM=; b=l2IMvOrJrjLMr2tVjbTU8vtQLMxSrxpYBjnhEZz/HlstKrpwh+GF2+kV1O8k8qiHJz 8ayVNYjU3ze8njZMqyBgJNh/X+PVGdxeAExlgqCjfSe4eDSaOetKtuYC+ijB1RSc56oJ vxfoicCJ4ueDvqdp9gjzEJyaqpPnGeCfHvB+Chs869TSgokEL9yE8mgR6QZ58sswfzYl 2Kj/tz5SCV90iFA9tctrgCma0CwjD0AN/ffnFfej85iekPT2W6Czu2+q0TcaKzxkuFPY p6Kts5piDifGtS371MA6rgekdrTTxGUX8Tzro8Y5rYma5Q5B9OWdmZshUq+X6Vw2ahQG iwjg== X-Forwarded-Encrypted: i=1; AJvYcCXpeo5iTAMJFlXiZ6SiWAgj2Vk7B2QErJst32BnGOuj9AkDZ04OPlPfcWj7fEuRUs+WqE4seIy6H2d3/Di7cXR1mn1pH7fIIae2Blcw X-Gm-Message-State: AOJu0Ywrl1/HE8DODA2oxlBjD1U2MsfgQZ9UhOpuc8Xo/k3tDJadZoBH fg/YlBMtCMXUedsd3ShYMB8FsVdRed3XsHYSv16qnyZ6tsQ/+8qstMCc2q90oH4= X-Received: by 2002:a17:906:b798:b0:a41:3d8b:80d with SMTP id dt24-20020a170906b79800b00a413d8b080dmr3872738ejb.37.1708892218531; Sun, 25 Feb 2024 12:16:58 -0800 (PST) Received: from krzk-bin.. ([178.197.222.116]) by smtp.gmail.com with ESMTPSA id ck13-20020a170906c44d00b00a3d7bcfb9a1sm1741045ejb.128.2024.02.25.12.16.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 12:16:58 -0800 (PST) From: Krzysztof Kozlowski To: Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Cc: Krzysztof Kozlowski Subject: [PATCH v2 2/2] iio: proximity: isl29501: make use of of_device_id table Date: Sun, 25 Feb 2024 21:16:54 +0100 Message-Id: <20240225201654.49450-2-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240225201654.49450-1-krzysztof.kozlowski@linaro.org> References: <20240225201654.49450-1-krzysztof.kozlowski@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791903396331719088 X-GMAIL-MSGID: 1791903396331719088 Reference the of_device_id table in the driver structure, so it will be used for module autoloading and device matching. This fixes clang W=1 warning: isl29501.c:999:34: error: unused variable 'isl29501_i2c_matches' [-Werror,-Wunused-const-variable] Signed-off-by: Krzysztof Kozlowski --- Rework according to comments. An old v1: https://lore.kernel.org/all/20230810111933.205619-1-krzysztof.kozlowski@linaro.org/ --- drivers/iio/proximity/isl29501.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iio/proximity/isl29501.c b/drivers/iio/proximity/isl29501.c index bcebacaf3dab..4982686fb4c3 100644 --- a/drivers/iio/proximity/isl29501.c +++ b/drivers/iio/proximity/isl29501.c @@ -995,17 +995,16 @@ static const struct i2c_device_id isl29501_id[] = { MODULE_DEVICE_TABLE(i2c, isl29501_id); -#if defined(CONFIG_OF) static const struct of_device_id isl29501_i2c_matches[] = { { .compatible = "renesas,isl29501" }, { } }; MODULE_DEVICE_TABLE(of, isl29501_i2c_matches); -#endif static struct i2c_driver isl29501_driver = { .driver = { .name = "isl29501", + .of_match_table = isl29501_i2c_matches, }, .id_table = isl29501_id, .probe = isl29501_probe,