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: 13571036 Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.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 A3F301B948 for ; Sun, 25 Feb 2024 20:16:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708892220; cv=none; b=K3QauGxdwr7ukTZrSHiQV5z/yZWc5Ovvvo298zE/6Apm3NpRx+xYVZ+yDIYpZFJkIzM/l9Dv86WaEVm0tH2f7q6yd+rg8/5IP3sL/VKQ4cfmd5Z1KBxuhggbQKaI0hlWoTaKWE33WYPXXiWE1yrgmURlHs9CMY8XSW2SaKKLek8= 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.218.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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="f5vSG4qX" Received: by mail-ej1-f50.google.com with SMTP id a640c23a62f3a-a26fa294e56so420625266b.0 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=R4D1kmY1bUf4wkyCkowqGS3JjNEr7vCmSU23e7hwUhjfCCxzph8SNbvCzmZ0Ob0/Rq ZQuvh7Lm/FnSHWzYSNFZQdwzjXlzdJcHu9tM/FIFe30oqbk5QBw7aFIRqb3YjjF5AVgG 3oYZRhhOUPQA+LAV9NG3lE0hQ1KlNETaK5YulBtCJRE682T61HCxD/4MYELUT2OSXG4l KfuQrrIp3Bv+HVtq4KLMvGpyq0aPAuEuGw5DxgCc3SfMgbc1+WUX52auSSuOqPx1Zj5j JrqdLYsk8SEs3gXKVbDmsmTiAxx9lsfOMPUp03tkgNW4LcSGfLq7eARfp8g1aUEtoPSf ZA5g== X-Forwarded-Encrypted: i=1; AJvYcCUZkkZTI+3z5VAykv2JX2S/8zmmvjokHjP/btbFM+a28SXhDcOuqzs3Ss9qbBZzvfisBlEzA48NVuB0mnkyICehiggb2qgq4N2V X-Gm-Message-State: AOJu0Yzof4yxcUBrhBK+Fa+RsZz6GGGa8fkFlpid9KBVkFkQHWNI6DuC RJ8YvZPtOXyl0OvOIl64/3CmAzL8TWfh4y9/Xtre2NkDfhEF0VYGpjuNYh2VMB8= X-Google-Smtp-Source: AGHT+IHwvup2ahGbonMPPRSZ4YpMn5V9B0o/2DNB+FUiQxsAjMoxZAEys1BsJfv7CQ90Ezd9DISwOg== 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-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: 13571037 Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) (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 171A11B946 for ; Sun, 25 Feb 2024 20:16:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708892221; cv=none; b=G2rc/hD+nmoMjGnZa36PIykK7X4yZ6CKr9VAyG2tsCbEEE6bu/5BL5TCIxmDWShoROgJ/vm78ygz+Ifepp3Oicr6y3NwMx/dxEVGeGUUcLSkVhAXi0EkrLnK90SIFtZet80F/Y1z80Arm6rugIXmGmyTvBLDFyqN7y89/ZB+Xlw= 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.47 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="jTSc2LUl" Received: by mail-ej1-f47.google.com with SMTP id a640c23a62f3a-a3ddc13bbb3so343896966b.0 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=CXACFWnlzYudtbT9CCSfNWqgahthvr6Db2fnys774N1GdhDVI7z/wtYLV93PQ/QSWX NCDoSf/2j8ByovV4wcYoqp0t2OU6xUe1yeKHLuuHyHJFPuCDnjjZebFVdCi0H4F+LD8W G1sPinB5WRsPRHwPnVz7Xe1lNlKu4p4lXDpAiWQPqWYwZJypM+l5q5bMBh1FQ6gMW+NX XAxJs7niM4estrMzYRCm7BLBmUFBBxoj4RtKhdv2mea5KkqIqMGag4T6S6iA2wYKD0MC Jj7liw2NeCGbfr1zLtYujvUKujEOQJOR2WBnrRe6Q7hkpU67QzCzoF64PbGZODsUZQq5 F0HQ== X-Forwarded-Encrypted: i=1; AJvYcCX1OQxhflJl/cvweNLeYNRj0fnryTZcDIMT8EfGnl0upVd/D7R3EidcO/DhdJdAmsRNeVp3lBFj0cHqroM2Uc6N2emeLXvzRvZN X-Gm-Message-State: AOJu0YwQ+igneUNPTvPGY/vQlnnMUsGvPlXOnP/7L7JRFUdZyZjoXpvc 9dYiG/9Fakh59J5QpwVg9Kp7Oq4VFRlMg5mqUt5/TK6a/3z+ohQaaJJWECiTvi1LfabozPCvV4T 2 X-Google-Smtp-Source: AGHT+IFmzrcv6/CgvFP65oBr1ISELI6gDrREcQehqqpSKx151vTi5mDUavH7OKS2JjWHlw2haKthsg== 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-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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,