Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp6708499rwb; Tue, 15 Nov 2022 02:33:14 -0800 (PST) X-Google-Smtp-Source: AA0mqf63MxlWPxn2RPt3z3IqLt/HkhmBpU0yHiOxWESmK+LqRDfIqYU8alcr5v5dDCEvBxNT9ra7 X-Received: by 2002:a17:902:ce0b:b0:188:9542:515 with SMTP id k11-20020a170902ce0b00b0018895420515mr3534685plg.102.1668508394425; Tue, 15 Nov 2022 02:33:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668508394; cv=none; d=google.com; s=arc-20160816; b=lzQWkgE3aBYjWejXDIl/RlbGt7RBYP1qzUx+H+e7prDpR0XBF9Q1wpbHMilZJzpWb/ qsqUd4LbyXvnnllxyCN8AFPvajWLYXF/I1ka+6JNVbvZgdn0ItSzg+If1EPak9l7P91p /bYfrRMrsuAQ287A08NQ+YRXJV3PflmizeEbIi+IqYqIMWQS+WxO34/MWzDYwqNPeqU0 yNmDzxRu6w/6Et+ANAcUBZmBsetNlUs1J4yF6oxRqJtTZWeJMGLzpbgkysLl70Ej+NlU DjmjvW6XTTsGVDLX25StqZo0IzaV4YP51fs319jP+rp8lqn5LSMXHQ3qyUFcEggExFlH XUww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=23t4Te+yw+Hqm+0pjO3fcF8NMLCFiSBxJI+O+j/PQU0=; b=qJI5/RWpLyoImCzuKrcMCTLG828M9lIaixu4hpC47WZaUTvaob2yIpK5dl24s7JUL9 yhzjf8YBKI4lp3WBd7wgIm/D/53iCjOsewDJTN7EbqlhZ0tML3MhI+KQQ4TC+WHI2VBq kf1tUc5MA0PBJd5hShcZLVfs1MWcUs28BX5q4cbRlAEvTiA2IrCbiUun0dkZGTRwFoVr te/J20woCEZKOLr8Y+4LEDXe78kJ4BiUQUKhDBXSADNGcgfu9yBbSZV4Oi8XDnWyP2kZ I5rF4Ak3pAdYuqAqPgzvRMyaWL4Mta0Zc+jxNXIxZx+JvKvnpH+8rgV1rXGzdLMfy8OL /QAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=WGBR5LG3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i69-20020a638748000000b004769d30f250si3145950pge.42.2022.11.15.02.33.02; Tue, 15 Nov 2022 02:33:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=WGBR5LG3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229969AbiKOJz2 (ORCPT + 89 others); Tue, 15 Nov 2022 04:55:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229754AbiKOJzY (ORCPT ); Tue, 15 Nov 2022 04:55:24 -0500 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F760AE61 for ; Tue, 15 Nov 2022 01:55:23 -0800 (PST) Received: by mail-lf1-x134.google.com with SMTP id be13so23622743lfb.4 for ; Tue, 15 Nov 2022 01:55:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; 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=23t4Te+yw+Hqm+0pjO3fcF8NMLCFiSBxJI+O+j/PQU0=; b=WGBR5LG3Z/5OspOwwBLwL/f4DQt3EbSb2GSsCAq4/4Rw17LYljrtFT1mtEQ3fRFSJk 2WMtRjfQ0B1/i/6BDPZzrgWNOY6nEpC4+rafytXiULnV9L7/txmaey99VFWBIgLG+6oi JrR1oXpfymU5E6oWJuu/rAeKeulGAP26vpa4k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=23t4Te+yw+Hqm+0pjO3fcF8NMLCFiSBxJI+O+j/PQU0=; b=1hFFc2bfMU6mFAJqU7ZJmLtPuXMeccwazR2dvtlA1/MpcprOYyQ2WOAYUmnIiGi0OO Mdob8DMyX9frzJh53WrKpUBJ6qX7IQmyNuzMlfOiE8vjp3rcSD2T+b+4BMxhcW7Z3w8x OMfle3N6yeZxtnp3DlkyN2Rzwf+1UlZxE8y2ksNEB4GIM2Ajhcb1CcLQ8nPcLcggfccp ejZtnz6lFwO9o4fRnxO0faFQKfEUWXU6QV/2ydUwsvIdzyhpHAGISbqS6AVYFgu88NIq 7Z3lZFCadaI516AKHvuGrqCC9jYFrIzcuek/E8T4WWxaIHEvyE3Q8H27YP/aVvnuCgAh H1tw== X-Gm-Message-State: ANoB5pkffQKeSvKgXCUqQonzpSN4Je3XLfZKY42THhlReuuvdbJwuXp+ f7UFR4aFo47IyvLhM9ggW+DfEg== X-Received: by 2002:a05:6512:a86:b0:4a4:72b0:9a2b with SMTP id m6-20020a0565120a8600b004a472b09a2bmr5104119lfu.469.1668506121475; Tue, 15 Nov 2022 01:55:21 -0800 (PST) Received: from prevas-ravi.prevas.se ([81.216.59.226]) by smtp.gmail.com with ESMTPSA id q3-20020a19f203000000b00493014c3d7csm2148598lfh.309.2022.11.15.01.55.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Nov 2022 01:55:20 -0800 (PST) From: Rasmus Villemoes To: Rob Herring , Lars-Peter Clausen , Michael Hennerich , Cosmin Tanislav , Jonathan Cameron Cc: devicetree@vger.kernel.org, Rasmus Villemoes , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/3] iio: addac: ad74413r: add spi_device_id table Date: Tue, 15 Nov 2022 10:55:15 +0100 Message-Id: <20221115095517.1008632-2-linux@rasmusvillemoes.dk> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20221115095517.1008632-1-linux@rasmusvillemoes.dk> References: <20221111143921.742194-1-linux@rasmusvillemoes.dk> <20221115095517.1008632-1-linux@rasmusvillemoes.dk> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Silence the run-time warning SPI driver ad74413r has no spi_device_id for adi,ad74412r Signed-off-by: Rasmus Villemoes --- drivers/iio/addac/ad74413r.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/iio/addac/ad74413r.c b/drivers/iio/addac/ad74413r.c index 899bcd83f40b..a157f2247a50 100644 --- a/drivers/iio/addac/ad74413r.c +++ b/drivers/iio/addac/ad74413r.c @@ -1305,6 +1305,15 @@ static int ad74413r_probe(struct spi_device *spi) st->spi = spi; st->dev = &spi->dev; st->chip_info = device_get_match_data(&spi->dev); + if (!st->chip_info) { + const struct spi_device_id *id = spi_get_device_id(spi); + if (id) + st->chip_info = + (struct ad74413r_chip_info *)id->driver_data; + if (!st->chip_info) + return -EINVAL; + } + mutex_init(&st->lock); init_completion(&st->adc_data_completion); @@ -1457,12 +1466,20 @@ static const struct of_device_id ad74413r_dt_id[] = { }; MODULE_DEVICE_TABLE(of, ad74413r_dt_id); +static const struct spi_device_id ad74413r_spi_id[] = { + { .name = "ad74412r", .driver_data = (kernel_ulong_t)&ad74412r_chip_info_data }, + { .name = "ad74413r", .driver_data = (kernel_ulong_t)&ad74413r_chip_info_data }, + {} +}; +MODULE_DEVICE_TABLE(spi, ad74413r_spi_id); + static struct spi_driver ad74413r_driver = { .driver = { .name = "ad74413r", .of_match_table = ad74413r_dt_id, }, .probe = ad74413r_probe, + .id_table = ad74413r_spi_id, }; module_driver(ad74413r_driver, -- 2.37.2