From patchwork Thu Jun 6 14:24:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13688561 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 62E1CC25B75 for ; Thu, 6 Jun 2024 14:25:54 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 5BE8B950; Thu, 6 Jun 2024 16:25:42 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 5BE8B950 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1717683952; bh=HxuTLkBQopINQRN4REuwcUtobjjBsG1xC011iW2JoWE=; h=From:To:Cc:Subject:Date:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=TDhPEl2lgEjoBHoTdRbFi+7TBtKmbR6ubm1raTaAMNDG4OEJTkGx5kagqgu8RTN8A Ea/Lqs9m/Nwd/5VrtrR0nGuFXrRZctveP9lh8o86E9QqrvuVzVaTPbIRLpQnC2xtHc Jc6gLAa1o2Pa3ik/PdhlKHhERZ2euN6pNpQLq+qY= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 404DDF805BB; Thu, 6 Jun 2024 16:25:10 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id C1E3DF805AF; Thu, 6 Jun 2024 16:25:09 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id C220BF804FD; Thu, 6 Jun 2024 16:25:05 +0200 (CEST) Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id ADA9EF80171 for ; Thu, 6 Jun 2024 16:25:00 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz ADA9EF80171 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=v/q1sZXm Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-a68ca4d6545so190191366b.0 for ; Thu, 06 Jun 2024 07:25:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717683900; x=1718288700; darn=alsa-project.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ULCmZTLH9n5CknDHZXV8N8Yow6DCNDPV4w3gxTOWljs=; b=v/q1sZXmInzyEZjykhd1dTLzI3qex1C/LGib3tCOWE2sBIJpE4n5Q3LbiJK56RVMIj WbiYyaOK2L2pmPeg8t48JBqksG7joOM4oNtvCJUSdK3SjDUvdxXGtSedYqoIxN7g6ZYb CMvg53Oxz7p2ENqd9xlA7iQiOgOHe8mLdA9EBjrLQnRoQoSCfEc7R+wNYW6WU9ShCTQD EGoMUPivJ3pzRQOkvC6Zm0wH8v1rRZG8enBoedqdmlXmVyEEUMYlQnPPFudBAup1CGt7 bvPQtHIxBGv7f6HEkqA0HfS5zQdaurZNg+kHl76VSdBiVOFBdKNhmaeUh8q6g6elpMOy zikg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717683900; x=1718288700; 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=ULCmZTLH9n5CknDHZXV8N8Yow6DCNDPV4w3gxTOWljs=; b=i1PBxr1Gir4Ru0aEbw61dnR1IVJ4jTsgYtyqjxjJfpUQtYvzyQufbMWazTcYtkbhfN FcT2rYA4HwRO3PByxDezliAiLIwNftWzE1nRDaXw8nTKOzlmjyEsIkdY+gHKWgG4RJ1y gBBPWsQREObYtPIj7aSZBT5Azt0mebI6CIMD1PYoPG+qTXlZaNHNAQ7iy+Z2MN4csVaH b4rhIF9zCTDcX/mW3x0dJR9i2ecuHFlXLbC5g2awaqr8co/hYPoeTpcdWXav0Y3aL5pY Y0bsK7VXPhnjrhwR9YzSiljo39zafs5Ts2Quyj0zLj4qEEV9pUghtFwtWjpfhiYg+5Dk 0zgg== X-Forwarded-Encrypted: i=1; AJvYcCV501Qej/ny9TBMX5FyQjz1PKmRakme8ltiTULQmvv4ZLpVry+o7f+nI8Cj3EYnXQdhsYhYmx9P+P/Gc2ZWBkjIB+Y/FJmmZUzUbd8= X-Gm-Message-State: AOJu0YxozynyMCQt7/HSASwH2QXDpLzOkfrorNQVPVbpJY2sqa2cAL0b leq07Y61u/car/Z87BNwUHCMEfdxSUaRIIGulTz1qGR2qL2q1fGTgXqGZx9bTL6BFQ/nT6XTtwE KnNOMvw== X-Google-Smtp-Source: AGHT+IFy5SbbOufUy/PtgBUt0Mn2h32RxYk6OQCJyJWhipcb0m0KlPl6vMlWDiXkxRkGrv3OlXeODQ== X-Received: by 2002:a17:906:4154:b0:a68:e268:fa30 with SMTP id a640c23a62f3a-a6c7651ad4emr200470666b.38.1717683899900; Thu, 06 Jun 2024 07:24:59 -0700 (PDT) Received: from krzk-bin.. ([110.93.11.116]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6c80582110sm104953466b.32.2024.06.06.07.24.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 07:24:59 -0700 (PDT) From: Krzysztof Kozlowski To: Lee Jones , Charles Keepax , Richard Fitzgerald , patches@opensource.cirrus.com, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org Cc: Krzysztof Kozlowski Subject: [PATCH 1/2] mfd: arizona: Simplify with spi_get_device_match_data() Date: Thu, 6 Jun 2024 16:24:56 +0200 Message-ID: <20240606142457.130553-1-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Message-ID-Hash: Y2BU6OUF6UW5S4MBKKRJPQOZZW7IUAK2 X-Message-ID-Hash: Y2BU6OUF6UW5S4MBKKRJPQOZZW7IUAK2 X-MailFrom: krzysztof.kozlowski@linaro.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Use spi_get_device_match_data() helper to simplify a bit the driver. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Charles Keepax --- drivers/mfd/arizona-spi.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/mfd/arizona-spi.c b/drivers/mfd/arizona-spi.c index de5d894ac04a..eaa2b2bc5dd0 100644 --- a/drivers/mfd/arizona-spi.c +++ b/drivers/mfd/arizona-spi.c @@ -190,19 +190,12 @@ static int arizona_spi_acpi_probe(struct arizona *arizona) static int arizona_spi_probe(struct spi_device *spi) { - const struct spi_device_id *id = spi_get_device_id(spi); - const void *match_data; struct arizona *arizona; const struct regmap_config *regmap_config = NULL; unsigned long type = 0; int ret; - match_data = device_get_match_data(&spi->dev); - if (match_data) - type = (unsigned long)match_data; - else if (id) - type = id->driver_data; - + type = (unsigned long)spi_get_device_match_data(spi); switch (type) { case WM5102: if (IS_ENABLED(CONFIG_MFD_WM5102)) From patchwork Thu Jun 6 14:24:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13688562 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5C9F2C25B75 for ; Thu, 6 Jun 2024 14:25:59 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 5E4CCA4A; Thu, 6 Jun 2024 16:25:42 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 5E4CCA4A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1717683952; bh=xJku9zrC1AGBM4qIss9yGk4RWlUTIUI3bVn4WgsRBgA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=I/C+Aqo/ZYkLQpKrUoyovdSqXxlUm2M7rQ9LiabbM6Q13KU8dpN9uiiVAXTpk1L+y zeYXn30z7K/6GnMig1KxRIUVNZqIMysU2QznmrZMZfIU4SrBe6tXvwfDW2hVOt4V6i t62cdlqKmCnr9HU0ZWZYO4TzA3af28qvJ1Cd517I= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 8F173F805AC; Thu, 6 Jun 2024 16:25:11 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 12095F805B3; Thu, 6 Jun 2024 16:25:11 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2FD03F804E5; Thu, 6 Jun 2024 16:25:07 +0200 (CEST) Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id DB99CF80088 for ; Thu, 6 Jun 2024 16:25:02 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz DB99CF80088 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=kxxr2R1C Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-57a1fe6392eso1260251a12.0 for ; Thu, 06 Jun 2024 07:25:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717683901; x=1718288701; darn=alsa-project.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=PVtqnXLiuL7l3W2O7J4uf50LECKlp3bPPW+XuGMKMgU=; b=kxxr2R1CxQjCHK1XvRIPJOcM43GwCMOCgZJacOqig7isEjPMakOdVSN/51kRmny+bH 639o/Yen/bSSTw8RVhFmxG31MbmpsomNLRMAbfM0IwsK97Dwplyh7mxWBo4rTr0RtHPH wW2sfC68UyzROq6cV2/IFIjpoGFzOb9z69TzpxAp7KRe9N/4pr5y03MVMXcMJVVo0/Lu cXc6qsBmCGmPVgvzFIWMvHS8b25WIKNH/oR/gxLeGHCxMTtegkveM/4KBS6acQ0BpJvn KY4dverMo07Rv8doCcKmNVJfUPwB7S6qRI62J4MTTWZDgl3UqMlU2BVa/0rkjnc7yEFe 2Y6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717683901; x=1718288701; 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=PVtqnXLiuL7l3W2O7J4uf50LECKlp3bPPW+XuGMKMgU=; b=knTAwY3rpSMuGLvXfTEZN7hcDAOXinVpTmdN2Jd7ySQYHmYRrcyzL3jFbz4yBodN6l kf4iieRojLaIpoUSmZvl/srq6aAYTAm0i5LI/UszFPVPdK+4TtB6Suc41swq1zcbkbtP eEH5ZVEG0q28vRt+a5PP8z1VrKSw8VoHd3lzO6XYi1u45W0f+VM+SefwlGRVZGndKGvb U9D6q5oBMfyoGbilt/vqsewtGEKYYrn8rQ68etviq5EV2eQVZ/V35J5vElW3Z5dqNXip I7/cap5tLqUjm6OPa8QWLC7IXA0jhT4pd5tPOzJtWDOdS0lndZX7lA6qKKIhf7sZ9VN4 Zx9A== X-Forwarded-Encrypted: i=1; AJvYcCXAiIn3hMkd1UHt1P7516TDVqOSCjWordz1yASY49f3S/M+tNIyVMYyyMI286EkO0IhGdvWK7hzIoK6Tu1h30isu2H29FwycrLuJ3w= X-Gm-Message-State: AOJu0YwXvxkB3S03jzaitDYxe6weZ1MPl2FjU4z7nHVmOf5zoVQwQn/M 5VxP1s4N4bY42it+f0vouXXw+5Ko570pJjRu7FeKWr6lRUo0RwoXkkmoVhmM7l4= X-Google-Smtp-Source: AGHT+IEO/my6BpSvTRKxq1xS59je88+5g73ZUGox37kyzNUmrfjMY4VeX3kfUHK+a9QRzvx7ruZs5Q== X-Received: by 2002:a17:906:840a:b0:a68:e1a8:9d2b with SMTP id a640c23a62f3a-a69a024f584mr362648366b.68.1717683901196; Thu, 06 Jun 2024 07:25:01 -0700 (PDT) Received: from krzk-bin.. ([110.93.11.116]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6c80582110sm104953466b.32.2024.06.06.07.25.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 07:25:00 -0700 (PDT) From: Krzysztof Kozlowski To: Lee Jones , Charles Keepax , Richard Fitzgerald , patches@opensource.cirrus.com, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org Cc: Krzysztof Kozlowski Subject: [PATCH 2/2] mfd: madera: Simplify with spi_get_device_match_data() Date: Thu, 6 Jun 2024 16:24:57 +0200 Message-ID: <20240606142457.130553-2-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240606142457.130553-1-krzysztof.kozlowski@linaro.org> References: <20240606142457.130553-1-krzysztof.kozlowski@linaro.org> MIME-Version: 1.0 Message-ID-Hash: 3BR4ONLMRK6IB53KES63VGIMQBCYEEKV X-Message-ID-Hash: 3BR4ONLMRK6IB53KES63VGIMQBCYEEKV X-MailFrom: krzysztof.kozlowski@linaro.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Use spi_get_device_match_data() helper to simplify a bit the driver. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Charles Keepax --- drivers/mfd/madera-spi.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/mfd/madera-spi.c b/drivers/mfd/madera-spi.c index ad07ebe29e59..ce9e90322c9c 100644 --- a/drivers/mfd/madera-spi.c +++ b/drivers/mfd/madera-spi.c @@ -18,21 +18,14 @@ static int madera_spi_probe(struct spi_device *spi) { - const struct spi_device_id *id = spi_get_device_id(spi); struct madera *madera; const struct regmap_config *regmap_16bit_config = NULL; const struct regmap_config *regmap_32bit_config = NULL; - const void *of_data; unsigned long type; const char *name; int ret; - of_data = of_device_get_match_data(&spi->dev); - if (of_data) - type = (unsigned long)of_data; - else - type = id->driver_data; - + type = (unsigned long)spi_get_device_match_data(spi); switch (type) { case CS47L15: if (IS_ENABLED(CONFIG_MFD_CS47L15)) {