From patchwork Wed Nov 15 20:58:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 13457362 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 52F0AC072A2 for ; Wed, 15 Nov 2023 20:59:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; 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=LBoDb9rNIqJon+vNAAs9xVEFzkYTohDnPnQ0OWd2fNE=; b=FD1DVKrF6CVCiu v/lUVwU7WQG0c8AGj46YT0ZGnrZkoruoNeWT0mE8bqdEGOIb30OZV/Iu/ZNayVelVVBpzop0Q9TdJ s6rdz0SZXvwvCVpaQHUvpXHmKYM2mcIifPcxylbBgX52eKNMH/ZtROhY5Qrii1da8bBAp3Ug+X36m lhXE0Uj0cd+e0FumwlglX4V8py3Fc36Cu366z5ht6A6dMUim/BCaUXYVGOoHWmabHNNEcFc2v1xG9 4YhNeh9b64U/Mdx1H2gJOGz4Rv3aIK0tmaBZU0LsxfkIP4bzzZq08ISa0jGjQi9//y0i3k3TjFkNJ 2mD2iZZPnhYOlCFS6xfA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r3Myb-001ieb-2m; Wed, 15 Nov 2023 20:59:09 +0000 Received: from mail-oi1-f169.google.com ([209.85.167.169]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r3MyZ-001idf-0h for linux-arm-kernel@lists.infradead.org; Wed, 15 Nov 2023 20:59:08 +0000 Received: by mail-oi1-f169.google.com with SMTP id 5614622812f47-3b2e72fe47fso63615b6e.1 for ; Wed, 15 Nov 2023 12:59:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700081945; x=1700686745; 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=rWue5MGrIGXtdwa0DXl26EeYVBaPfv4b8agF9tN7BTk=; b=lxDxNnJQkeQxJerhZ39INS5vFjDrHmbtz/F/je9oX6DEUMY0QCy7aXguqRj0Qc7H/A G1zEfAr8nXB1M1TzPhhBJYbQ3zpmoFcC9ZKpJpOoceHfa5bS/It+q+TFkELxw94US2/M 9+uMQ64zrsPDfOtwW9ZMS0SMpELioa/z2yHnBUwyhdaZajcoRRwpqNLSk0liQkZazksL tUNXQ/e6ZX5qAEN9rSAEdx+fJkghdae6srWLndoSX55b+12wBGj9U7pt27VMELtsDrDE WLt6wW5F0UXnozP8HslZu++LzNFfxTdjBs1laIT6uFCRY8X8TH7vFwbvLB0bIKjBm6rX zuSw== X-Gm-Message-State: AOJu0Yw6nRjPUhyP24+HdEUFs2i5L+hYzw37tYtZUp3H0Mv1p5hI4vun sDWcYGaK4BbFyzIBMGi+MQ== X-Google-Smtp-Source: AGHT+IFuVEdngiswllHpeBpLA6ZHJAf8BU1GB6j5HsXZXn+UNlYH2/CSecjlOqxQWtnfpSG25qCQ2A== X-Received: by 2002:a05:6808:4193:b0:3b6:cb02:533b with SMTP id dj19-20020a056808419300b003b6cb02533bmr13975007oib.44.1700081945112; Wed, 15 Nov 2023 12:59:05 -0800 (PST) Received: from herring.priv (66-90-144-107.dyn.grandenetworks.net. [66.90.144.107]) by smtp.gmail.com with ESMTPSA id a9-20020a05680804c900b003b29c2f50f0sm1588527oie.18.2023.11.15.12.59.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 12:59:04 -0800 (PST) Received: (nullmailer pid 3732930 invoked by uid 1000); Wed, 15 Nov 2023 20:59:01 -0000 From: Rob Herring To: Avi Fishman , Tomer Maimon , Tali Perry , Patrick Venture , Nancy Yuen , Benjamin Fair , Philipp Zabel , Patrice Chotard Cc: openbmc@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [RESEND PATCH] reset: Use device_get_match_data() Date: Wed, 15 Nov 2023 14:58:48 -0600 Message-ID: <20231115205848.3732609-1-robh@kernel.org> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231115_125907_251106_67C3A9E0 X-CRM114-Status: GOOD ( 15.03 ) 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 preferred device_get_match_data() instead of of_match_device() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Signed-off-by: Rob Herring Reviewed-by: Patrice Chotard --- drivers/reset/reset-npcm.c | 5 ++--- drivers/reset/sti/reset-syscfg.c | 11 ++++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/reset/reset-npcm.c b/drivers/reset/reset-npcm.c index f6c4f854f2be..8935ef95a2d1 100644 --- a/drivers/reset/reset-npcm.c +++ b/drivers/reset/reset-npcm.c @@ -6,8 +6,8 @@ #include #include #include -#include #include +#include #include #include #include @@ -351,8 +351,7 @@ static int npcm_usb_reset(struct platform_device *pdev, struct npcm_rc_data *rc) } } - rc->info = (const struct npcm_reset_info *) - of_match_device(dev->driver->of_match_table, dev)->data; + rc->info = device_get_match_data(dev); switch (rc->info->bmc_id) { case BMC_NPCM7XX: npcm_usb_reset_npcm7xx(rc); diff --git a/drivers/reset/sti/reset-syscfg.c b/drivers/reset/sti/reset-syscfg.c index c1ba04f6f155..2324060b747c 100644 --- a/drivers/reset/sti/reset-syscfg.c +++ b/drivers/reset/sti/reset-syscfg.c @@ -7,10 +7,11 @@ */ #include #include +#include #include #include #include -#include +#include #include #include @@ -183,14 +184,14 @@ static int syscfg_reset_controller_register(struct device *dev, int syscfg_reset_probe(struct platform_device *pdev) { struct device *dev = pdev ? &pdev->dev : NULL; - const struct of_device_id *match; + const void *data; if (!dev || !dev->driver) return -ENODEV; - match = of_match_device(dev->driver->of_match_table, dev); - if (!match || !match->data) + data = device_get_match_data(&pdev->dev); + if (!data) return -EINVAL; - return syscfg_reset_controller_register(dev, match->data); + return syscfg_reset_controller_register(dev, data); }