Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp964508rbb; Sun, 25 Feb 2024 12:17:06 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVqoBRxV0oDDamB6OmB7y11Y4NQRV5OI2T1PIViq3gsyfPVtgfaYZ/PdLmPVM8yaPemqgUg31RB4dag2t2OQF/Yp256wcTxFjd33R5TaQ== X-Google-Smtp-Source: AGHT+IFiIBml1YDeeejtdc8LCsHxYnCxQuiohTY4io/8v0llVrLR63hddumiUk5wtuyHn43FCaXU X-Received: by 2002:aa7:c64d:0:b0:565:9938:a881 with SMTP id z13-20020aa7c64d000000b005659938a881mr3452873edr.36.1708892226468; Sun, 25 Feb 2024 12:17:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708892226; cv=pass; d=google.com; s=arc-20160816; b=eZ69NmZKF3/I+92iE+cE0Hfesh2TkdhQsHdmmJS8mm1nhTu4CHQl60x9rCYORqzVat 9lRGKPU1XNLETqyEUgUZ2On7mna7Qm9ts5/4ssXRKtEry+j/OZBZ7djft0Ucxk7eAHT6 ozNfvJKOjfyke97tua52m/KfyQy0kV7stW12HoI0hu7tPeQySywFUxRS1RKOMHwfJzV3 gsNvW4a1JYkF2x1AIk+afRP2pyNTSJ1xSqhspSkHPxziQ0EB/6HfSm8BGiTt2SN5ymcq OfNdGihBVThMNyTZMB9TKu9U8N7fMipyK6UeAl6hxPsVeX6y9rvCbRh96U5pWhd/t6U/ KfvA== 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-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80272-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id f21-20020a50ee95000000b005643f5aa720si1494597edr.392.2024.02.25.12.17.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 12:17:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-80272-linux.lists.archive=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=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-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80272-linux.lists.archive=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 3C79F1F2267A for ; Sun, 25 Feb 2024 20:17:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 81E291B810; Sun, 25 Feb 2024 20:17:01 +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 Content-Transfer-Encoding: 8bit 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, -- 2.34.1