From patchwork Sun May 1 10:34:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 12833597 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 887FFC433EF for ; Sun, 1 May 2022 10:35:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344522AbiEAKi0 (ORCPT ); Sun, 1 May 2022 06:38:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344711AbiEAKiQ (ORCPT ); Sun, 1 May 2022 06:38:16 -0400 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB708DEEE for ; Sun, 1 May 2022 03:34:51 -0700 (PDT) Received: by mail-ej1-x62e.google.com with SMTP id kq17so23069703ejb.4 for ; Sun, 01 May 2022 03:34:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=vHtGiwef2dz9fg142iHKNmyNB93LeSN0WJVlgXLSJeA=; b=ZiBy8AAwXRIQDb4eipR3rYvyBUQLvxEuYJlQ7hJvlfa8QhkLB6cS+WDPIQRMJzgsia XfyrPBhsKUSer6cIRoaRR7gtYu7EGBjFg4VAKya+pHVyjQQFu2UMkudHGiiXr2dcPZLc YEK2Gg8Ry+GyiZBWV2GE1klM97vmQ5ltbCSUV8QBPXIun8vo8WTcgbQm2lANJUhc1guk bLRH87kf0aBf36Jst+BcJK6B0BzOtwh03gYWwTG/hSpytged597v9R6zdiE4HVBps/mm ECoF+MDYUTZeNJHq7faFFAfOp6GdCO14WIHX4Rdy0a+tDcRbidy/6gS+jbxDX3MptQ+a 37sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=vHtGiwef2dz9fg142iHKNmyNB93LeSN0WJVlgXLSJeA=; b=KgVusy4k7Bu+BD3gefCldWCy4XwS7V6Y2P+XPShokVFzai0UUqYQRKPXw7MObjJfIC GHLrp4pN1+9cAEHKXuAszNWkgYPG+8/SzxCR008XiLm0Qn91Kmt86Dy6NGFk7QWgXUFT 2e73cHo1ks5EeHeVGrn6EXe0D4QwakfHpsA66zYV+qFa0OTavvB2/LV7SEtlZ/vz+EsP BJM/Otd78Q/JfuwFeMJmPS3N4VsYzZ91By8/FDhOeZztS1YWpQUKoi4MZKDTr6lHs+b+ 8dLAFYgv0dmwv4c5/rdhGZ7WINsz05GJ8iurSVbFtGItEWVnj8oKHU98BfnkUSgQchto RyoA== X-Gm-Message-State: AOAM530kbu71CbptlQw7k1ephKnrjs7bXBs2oomDRRu4EKyKFX9gHboP wjpAWjybtuMjU1xjY3w3b7yNdA== X-Google-Smtp-Source: ABdhPJxq4DgO/P3uaMY15/vVwOPYXLDmQLY+kki3wiNdStibVXVMEcRIfzHdj+9FmES9/ahJpjZ9NA== X-Received: by 2002:a17:906:148a:b0:6f3:833d:5a0f with SMTP id x10-20020a170906148a00b006f3833d5a0fmr6933104ejc.49.1651401290366; Sun, 01 May 2022 03:34:50 -0700 (PDT) Received: from localhost.localdomain (xdsl-188-155-176-92.adslplus.ch. [188.155.176.92]) by smtp.gmail.com with ESMTPSA id rb48-20020a170907693000b006f3ef214e11sm2492945ejc.119.2022.05.01.03.34.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 May 2022 03:34:49 -0700 (PDT) From: Krzysztof Kozlowski To: Jonathan Cameron , Lars-Peter Clausen , Maxime Coquelin , Alexandre Torgue , linux-iio@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH 1/2] iio: stmpe-adc: use of_device_id for OF matching Date: Sun, 1 May 2022 12:34:46 +0200 Message-Id: <20220501103447.111392-1-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org The of_device_id was added to allow module autoloading, but it should be also used to allow driver matching via Devicetree. This also fixes W=1 warning: drivers/iio/adc/stmpe-adc.c:357:34: error: ‘stmpe_adc_ids’ defined but not used [-Werror=unused-const-variable=] Signed-off-by: Krzysztof Kozlowski --- drivers/iio/adc/stmpe-adc.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/iio/adc/stmpe-adc.c b/drivers/iio/adc/stmpe-adc.c index d2d405388499..0208789fc0f5 100644 --- a/drivers/iio/adc/stmpe-adc.c +++ b/drivers/iio/adc/stmpe-adc.c @@ -345,21 +345,22 @@ static int __maybe_unused stmpe_adc_resume(struct device *dev) static SIMPLE_DEV_PM_OPS(stmpe_adc_pm_ops, NULL, stmpe_adc_resume); +static const struct of_device_id stmpe_adc_ids[] = { + { .compatible = "st,stmpe-adc", }, + { }, +}; +MODULE_DEVICE_TABLE(of, stmpe_adc_ids); + static struct platform_driver stmpe_adc_driver = { .probe = stmpe_adc_probe, .driver = { .name = "stmpe-adc", .pm = &stmpe_adc_pm_ops, + .of_match_table = stmpe_adc_ids, }, }; module_platform_driver(stmpe_adc_driver); -static const struct of_device_id stmpe_adc_ids[] = { - { .compatible = "st,stmpe-adc", }, - { }, -}; -MODULE_DEVICE_TABLE(of, stmpe_adc_ids); - MODULE_AUTHOR("Stefan Agner "); MODULE_DESCRIPTION("STMPEXXX ADC driver"); MODULE_LICENSE("GPL v2");