From patchwork Mon Apr 19 08:17:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 12211085 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, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 20737C43460 for ; Mon, 19 Apr 2021 08:17:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E389561107 for ; Mon, 19 Apr 2021 08:17:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236871AbhDSISH (ORCPT ); Mon, 19 Apr 2021 04:18:07 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:50447 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234668AbhDSISG (ORCPT ); Mon, 19 Apr 2021 04:18:06 -0400 Received: from mail-ej1-f72.google.com ([209.85.218.72]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lYP67-0007v6-R9 for linux-samsung-soc@vger.kernel.org; Mon, 19 Apr 2021 08:17:35 +0000 Received: by mail-ej1-f72.google.com with SMTP id k5-20020a1709061c05b029037cb8a99e03so3341878ejg.16 for ; Mon, 19 Apr 2021 01:17:35 -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:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tc7UDOgzQIAykIaB+pmrJMasrN1QkIFHd3HQXapxUk8=; b=b9aL/nKKZCDzqqIZXODOlmTkkauHJwmNLh6lgv6KUvoXlfAr0h/Ro1fSk2i8bdYS7Q +hO7xjXC/asKBXE2CDgDmYZgzSgoiHXLFnUUMvTRey4F9860Z/shncFgQ75paLALOB7P UIm41XypNJVjkmeAI/mZwzvGV3WkgXPfpXoseYwrkOooryghx3W5if2VnuRJFR2qAtqH Vei1ZjQCaAu6/uHSYriC5gnNN7cdUUNS9swqjFCzyLzC+N47NjCqos18UjATmDIhLcI/ hzr9baQtZzW35ZoTOHnDsjeyvn2UIRPUwMQ6g1qZRVe7Mf9YdrboBq4KLdtBUT4ZkyKM BNTQ== X-Gm-Message-State: AOAM533GemTg3sLu/qWkw91TjnZOt/4kOV3ZUVPSHvsa9Al35bE1kQ+Z fQcqNAONUq9Ol+YJEcV738RhV2IP+cKvRf64UN3UOOdrmoZKUF4ixdyrHLpm1kybTfjK1i51e2I ZJGYYzylqTzkM46Y+4LMEMq6wHR/35cGZSimw888aOfwevxG+ X-Received: by 2002:a17:906:b355:: with SMTP id cd21mr20275791ejb.504.1618820255600; Mon, 19 Apr 2021 01:17:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzuNTd9ZhGvDTg10FMK/NZMBEOBVAcdqe+s6V+fPsy8k7y7PvbXCS1lhxfXbnNILmmvl5bcsA== X-Received: by 2002:a17:906:b355:: with SMTP id cd21mr20275768ejb.504.1618820255421; Mon, 19 Apr 2021 01:17:35 -0700 (PDT) Received: from localhost.localdomain (xdsl-188-155-192-147.adslplus.ch. [188.155.192.147]) by smtp.gmail.com with ESMTPSA id da13sm12384781edb.6.2021.04.19.01.17.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Apr 2021 01:17:35 -0700 (PDT) From: Krzysztof Kozlowski To: Support Opensource , Lee Jones , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Tony Lindgren , linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-omap@vger.kernel.org, patches@opensource.cirrus.com Subject: [PATCH 5/7] mfd: sec: Simplify getting of_device_id match data Date: Mon, 19 Apr 2021 10:17:24 +0200 Message-Id: <20210419081726.67867-5-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210419081726.67867-1-krzysztof.kozlowski@canonical.com> References: <20210419081726.67867-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Use of_device_get_match_data() to make the code slightly smaller. Signed-off-by: Krzysztof Kozlowski --- drivers/mfd/sec-core.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c index 8d55992da19e..3126c39f3203 100644 --- a/drivers/mfd/sec-core.c +++ b/drivers/mfd/sec-core.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -324,12 +325,8 @@ static inline unsigned long sec_i2c_get_driver_data(struct i2c_client *i2c, const struct i2c_device_id *id) { #ifdef CONFIG_OF - if (i2c->dev.of_node) { - const struct of_device_id *match; - - match = of_match_node(sec_dt_match, i2c->dev.of_node); - return (unsigned long)match->data; - } + if (i2c->dev.of_node) + return (unsigned long)of_device_get_match_data(&i2c->dev); #endif return id->driver_data; }