From mboxrd@z Thu Jan 1 00:00:00 1970 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 A3C48C433EF for ; Tue, 12 Apr 2022 04:37:49 +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:References:In-Reply-To: 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: List-Owner; bh=uSabvXYIa1JXNmH/sA2bQw7T5uSe8OGlV18h43oJMmM=; b=kepm0oWmLyAs14 1u49zd0JZZ/vBvT/OPMC4ph8xOVkBd711NaK8VxPsLYGqB3/JJ4+Z1xLvkR55sXDFds/DbdtpkSYI IrzWayGQVd0fh2WLHRr6fsoOfGyniVoMZJgmlDxS6147WTuqkug6G4CYhoq0PJTWRjk73EPawnuGl MIFztEcP8HK26Eg36JUxRu3pSrugolBe/8dkdBAuWUEftd3w89JzalYM54e0nQ0yLfI80Z8tj3G0R HK01GXhBxqPp15exmPzG7ScZdvToOC/BGI72Hvj0tb2TWITcLuqL8o09GoYO8UVVJeCH3cBzoeqoM zSGqHIugkAgqV42gem9Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ne8GN-00Bb8V-AV; Tue, 12 Apr 2022 04:36:23 +0000 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ne8FM-00Bahd-PS for linux-arm-kernel@lists.infradead.org; Tue, 12 Apr 2022 04:35:22 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id A220F3201F1D; Tue, 12 Apr 2022 00:35:17 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Tue, 12 Apr 2022 00:35:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1649738117; x=1649824517; bh=1I qQYnRka1Fn2JNjNzWi/7Wa2m9c8upmD64g6JA+rj4=; b=tHSEbpYszKFAdbvQ+C X3IUFwhjNvr+nGM/B08iwfWNRk+CoDNpjHcxBA4yPiIMi60bgA62HlZrpPqOhOJH 3hggWmelLXYbyp4iibiLgsQG0AGyAN4q03YA1Gx5lpaLZxiGKgDF3Te8kTBc7O8H n0TC7sw9P5ECBKc/tL8V101tyfxrWybnF1yw6xtL9oo2C76BhSQkWORYtHrKi3In FBe3P8jfpxB2RdQ24f7xN1y7q418UGuSnmxQ3t5o+hLT0EzF777Tz8r1/oPwd6v2 IQyvaA756ocWM+nK+0N7Hqk45G8+gMnfsQ0Ge1RH8wcyKgKie/bjOTnI/45M7ykQ 0U+A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1649738117; x=1649824517; bh=1IqQYnRka1Fn2JNjNzWi/7Wa2m9c8upmD64 g6JA+rj4=; b=SmOp4SrM0CtJFG07PVzxpCQWkRdBIu9HxlTUXxGbaiZ3fqE/CJy qFZ8zvW5wp3vfaD+YjZe9kQ+rT4cNncB4TGtvSvn7V669KUtB7Yn2gqD5YU9WsLp gcZYEByB9Fj0Fpo9b72wQs4VwDfpfsDedl1y+Fo/TV4zy6Jkc/Kzvh2S/GoBCExc 2bHVTy2ca4MFnlyiPdz1rQqvNiLZEQo7X+JYO8BCvxXV4qcwuv7oRsQDoni8KAyh GijDYlY+skkJkfp00ZIy2Nv82MUm3JcfXt038vY7pTG3v776JTBHtGYvV16MmN+D Kc8XDP1jZJaOj+i9rq650VCDKw4r3HDFcBQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudekjedgkeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefurghmuhgv lhcujfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenucggtf frrghtthgvrhhnpeduhfejfedvhffgfeehtefghfeiiefgfeehgfdvvdevfeegjeehjedv gfejheeuieenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 12 Apr 2022 00:35:16 -0400 (EDT) From: Samuel Holland To: Chen-Yu Tsai , Jernej Skrabec , Maxime Ripard Cc: Samuel Holland , Daniel Vetter , David Airlie , Philipp Zabel , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev Subject: [PATCH 1/6] drm/sun4i: sun8i-hdmi-phy: Use of_device_get_match_data Date: Mon, 11 Apr 2022 23:35:06 -0500 Message-Id: <20220412043512.49364-2-samuel@sholland.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220412043512.49364-1-samuel@sholland.org> References: <20220412043512.49364-1-samuel@sholland.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220411_213520_880632_5DB1E54B X-CRM114-Status: GOOD ( 14.74 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Now that the HDMI PHY is using a platform driver, we can use the usual helper function for getting the variant structure. Signed-off-by: Samuel Holland --- drivers/gpu/drm/sun4i/sun8i_dw_hdmi.h | 2 +- drivers/gpu/drm/sun4i/sun8i_hdmi_phy.c | 11 ++--------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.h b/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.h index bffe1b9cd3dc..0adbfac6eb31 100644 --- a/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.h +++ b/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.h @@ -173,7 +173,7 @@ struct sun8i_hdmi_phy { unsigned int rcal; struct regmap *regs; struct reset_control *rst_phy; - struct sun8i_hdmi_phy_variant *variant; + const struct sun8i_hdmi_phy_variant *variant; }; struct sun8i_dw_hdmi_quirks { diff --git a/drivers/gpu/drm/sun4i/sun8i_hdmi_phy.c b/drivers/gpu/drm/sun4i/sun8i_hdmi_phy.c index 5e2b0175df36..7b901aef789a 100644 --- a/drivers/gpu/drm/sun4i/sun8i_hdmi_phy.c +++ b/drivers/gpu/drm/sun4i/sun8i_hdmi_phy.c @@ -565,7 +565,7 @@ void sun8i_hdmi_phy_deinit(struct sun8i_hdmi_phy *phy) void sun8i_hdmi_phy_set_ops(struct sun8i_hdmi_phy *phy, struct dw_hdmi_plat_data *plat_data) { - struct sun8i_hdmi_phy_variant *variant = phy->variant; + const struct sun8i_hdmi_phy_variant *variant = phy->variant; if (variant->is_custom_phy) { plat_data->phy_ops = &sun8i_hdmi_phy_ops; @@ -672,7 +672,6 @@ int sun8i_hdmi_phy_get(struct sun8i_dw_hdmi *hdmi, struct device_node *node) static int sun8i_hdmi_phy_probe(struct platform_device *pdev) { - const struct of_device_id *match; struct device *dev = &pdev->dev; struct device_node *node = dev->of_node; struct sun8i_hdmi_phy *phy; @@ -680,17 +679,11 @@ static int sun8i_hdmi_phy_probe(struct platform_device *pdev) void __iomem *regs; int ret; - match = of_match_node(sun8i_hdmi_phy_of_table, node); - if (!match) { - dev_err(dev, "Incompatible HDMI PHY\n"); - return -EINVAL; - } - phy = devm_kzalloc(dev, sizeof(*phy), GFP_KERNEL); if (!phy) return -ENOMEM; - phy->variant = (struct sun8i_hdmi_phy_variant *)match->data; + phy->variant = of_device_get_match_data(dev); phy->dev = dev; ret = of_address_to_resource(node, 0, &res); -- 2.35.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel