From patchwork Wed Apr 14 20:33:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 12203757 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88596C43460 for ; Wed, 14 Apr 2021 20:36:38 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0651C61164 for ; Wed, 14 Apr 2021 20:36:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0651C61164 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=canonical.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=SVKUBhVK1VlhYl990MoCCtBw5t/odniij5bDT5SOpjE=; b=bGJXt6Yu0lL7NEwDtAaRKFTInE JvI9f0SvF6B2QaM8VTAFr/KTUe/0WAb1iORsWySKvziYicETMvDwqluDp00uBnfjdkrytkbTU4pwQ i917XEy3WZwHb5tQ0DUHO9klaUF1c5VY6uzRKIFN1nUOrIRp7Ie5z78n/uvjXpvBPURoX0Pl/UEc4 lQMwWGiH+w0I2cR98LS/RRPKisysEoRTSHjfwUal+6W++TnbctT5YVD7MERSDKg52V23Yzj51jUn3 69eV5uMT1WwFiAIS7s+oluvAO4IJcuGjFZxKUkYcRuI+fse252J3aFuch+VomxZMM2xX+SSkd4CoL AoaIE1bQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lWmDI-00DimV-Pl; Wed, 14 Apr 2021 20:34:17 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lWmDB-00DilQ-7w for linux-arm-kernel@desiato.infradead.org; Wed, 14 Apr 2021 20:34:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:In-Reply-To:References; bh=x2hO5DXMeLJZo3Sq4pJYNG0FO8H5GrNmCBQcI+p7buM=; b=K2bbexqHmTMqva73EznO41ZfHo +F+P/qRWhhMKjXVUhk37sNXVHlMLvtoAbqh3U7uEJ0dsn6XmphqN9FWWVOqRQEVac7UYQp0tJwDZH RbohaocJUjb3ptAuC1UWog6MzC6QCJ/6hq2AAV7AW4OS8uoRclEsspxKusJok21LybC1NpCm/o+Fr UKOPrPhb0JapZnpDDbOzoVhghIMJw2APyUD3xpFmMx9l9qskF7p/IW3Pp1MUHPe7Zkr/dv8UDiTbs mO2zPaqqTOsDxlZLQBqrLWpErPuZq7rT2ChCFFLrCcp83gmrB/DsXurGRad7I74HuJt9sOjtrJVYW u3Wz/svg==; Received: from youngberry.canonical.com ([91.189.89.112]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lWmD8-0085dN-Kn for linux-arm-kernel@lists.infradead.org; Wed, 14 Apr 2021 20:34:08 +0000 Received: from mail-ej1-f70.google.com ([209.85.218.70]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lWmD3-0007Qb-LD for linux-arm-kernel@lists.infradead.org; Wed, 14 Apr 2021 20:34:01 +0000 Received: by mail-ej1-f70.google.com with SMTP id p25-20020a1709061419b0290378364a6464so217716ejc.15 for ; Wed, 14 Apr 2021 13:34:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=x2hO5DXMeLJZo3Sq4pJYNG0FO8H5GrNmCBQcI+p7buM=; b=Lt/4TNojCXXEakOXktRrUhzcvB7TFO55SM3r8kce3iGT7VPLWi42wTeuWfSrfi89r+ /aESQ5enc6jHTjTKOm/a7R09R1D30HBy3Q6QaRh0wtMt0ydq5KELM6/PsAWZ2P1MQNm4 azR+8HNsItgisIYze475FPvMLyYLl621vvzzKQ8Cnn+vyCLWRC3qFTSahk4eQY+MOguB sR77aGliX29lo6PajI+uNQVRZL+Xn7jppjeBehy7rmLhf8kBPjfBxYMp9v9L66s3Px2d QA5qk0yN2ynyyN4nvj9nlKxmVuPUTw7kAxtaJqSVNzQg+OTos2abFG1rlU/F5KvNxxvv EUnA== X-Gm-Message-State: AOAM530Zvqpa7VxzqUnBFCsD1AqWCC5VoiHxSOwQzYCO088s7nhKZaV/ fU7bRu1AdrLx+NUZcxxN6qdrJAvL0YZovVQ7th+6e1gIsiXF4M/9bKMrj3p+qvWoULYus4fF5LA gsGqPL5vAuBZuG371MP2Gqr5ADUGazVRxmDebYHAKbfwEVVUSnzC9 X-Received: by 2002:a05:6402:5189:: with SMTP id q9mr72095edd.168.1618432441434; Wed, 14 Apr 2021 13:34:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8Z5ptlAYigxFNCd5S/xT8AwrP3ue/ADlxR9AJcWKfkq3TLq+hwkPI3X1JJfIFB9MPghvAVg== X-Received: by 2002:a05:6402:5189:: with SMTP id q9mr72086edd.168.1618432441295; Wed, 14 Apr 2021 13:34:01 -0700 (PDT) Received: from localhost.localdomain (xdsl-188-155-192-147.adslplus.ch. [188.155.192.147]) by smtp.gmail.com with ESMTPSA id q6sm372209ejt.51.2021.04.14.13.34.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Apr 2021 13:34:00 -0700 (PDT) From: Krzysztof Kozlowski To: Krzysztof Kozlowski , Andi Shyti , Mark Brown , linux-spi@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki Subject: [PATCH 1/3] spi: s3c64xx: simplify getting of_device_id match data Date: Wed, 14 Apr 2021 22:33:41 +0200 Message-Id: <20210414203343.203119-1-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210414_133406_860225_EA721951 X-CRM114-Status: GOOD ( 12.89 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Use of_device_get_match_data() to make the code slightly smaller and to remove the of_device_id table forward declaration. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Sylwester Nawrocki --- drivers/spi/spi-s3c64xx.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index dfa7c91e13aa..c6d7641ea342 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include @@ -1048,17 +1049,12 @@ static struct s3c64xx_spi_info *s3c64xx_spi_parse_dt(struct device *dev) } #endif -static const struct of_device_id s3c64xx_spi_dt_match[]; - static inline struct s3c64xx_spi_port_config *s3c64xx_spi_get_port_config( struct platform_device *pdev) { #ifdef CONFIG_OF - if (pdev->dev.of_node) { - const struct of_device_id *match; - match = of_match_node(s3c64xx_spi_dt_match, pdev->dev.of_node); - return (struct s3c64xx_spi_port_config *)match->data; - } + if (pdev->dev.of_node) + return (struct s3c64xx_spi_port_config *)of_device_get_match_data(&pdev->dev); #endif return (struct s3c64xx_spi_port_config *) platform_get_device_id(pdev)->driver_data;