Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1828115pxb; Mon, 20 Sep 2021 06:19:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwzJwNyIaTB3CtJkJ24tsBty15V9ThTVA7aiSacXvX3B+YwaY9IR1LWKYp7ZXjijEPOb3Wi X-Received: by 2002:a17:906:e216:: with SMTP id gf22mr28094594ejb.357.1632143971943; Mon, 20 Sep 2021 06:19:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632143971; cv=none; d=google.com; s=arc-20160816; b=mCWq0xxTv4AkYEKrAPugdvooUEwLXWhbN+oIAtMojeRVsyb+7FminVrWTqyMZiHiFD wXpPNPRA6xshLRyVqhsQ67ElLWkiYZoDRZSbEcKh8V4ncBafsF5NIjwWt7IcR8oosDIq 4hGtPv5w7V4DGWDFyWqbmQAUhDu+dLrQQQPMAkEuyV4vK6nt579uXV649E4q2q3z0MBB aXqtmED9lO3aMNwQRs6EeMpS95Y8GWV4MKTdohB/j/sgVxG+4aD7YnXN570Vnp3qoVF6 q0CcC6yCz7Zt7gUCiSzSUcz3qvH0itSybBmizfWQJ4QXk0ZEYWTrrF+Sbf5LgC09XESt 5Q9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=xV4eXWIk0gYGAKfUV311VVVNInR4dun4nm3r0J2zqoM=; b=tSQklQYJMUAvXDvGB9CMsV4R2eDWFPHLJqbTcre59yqTsJPiajanjt4LxhPp9w3Ke5 5zAM+cfY6IsWgzTCLLywqu4BNWUHLE17GlKG3oUXX9Atg0m0+rJcZXfqs9Ls6K75ml5V vCvDTaPwg/dgkXwywsxj7IfiZ6fagMGULhLc2owm6J9qvlbZy31N5IrFEwv1w5xUdLsH 5ipVkQFKiN4As0bA0Iwiyfcl4eV7R3eBZl8rhNAYU6LU4y6S8iX1kXk3HZd6/c5I2/kr kWvvfFcsJhQvuIldK/+CzCZrCT0JrTlt/esnqSTW+2fr137yvzcuYQH0PmYdVSKXkOZr 3EaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@sang-engineering.com header.s=k1 header.b=ENT1r8KQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hy1si15136084ejc.545.2021.09.20.06.19.07; Mon, 20 Sep 2021 06:19:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@sang-engineering.com header.s=k1 header.b=ENT1r8KQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236154AbhITJHT (ORCPT + 99 others); Mon, 20 Sep 2021 05:07:19 -0400 Received: from www.zeus03.de ([194.117.254.33]:54160 "EHLO mail.zeus03.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236004AbhITJHI (ORCPT ); Mon, 20 Sep 2021 05:07:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=sang-engineering.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=k1; bh=v+d2EKH5Hm5rpn klW0GzaZ84yipAYJED4MgP1hNorRw=; b=ENT1r8KQ+FnFXriV0P7EoLlZR5qLmH 4EOYIViXe50IwSpt8xAZqjd/BTaHNLa2HBMyuczSsS5CrB6fR6SgiWtgbCpPPdDe uLB7SYVDrfMhxPNElI7Oa7CoAH33R8I5BsLwrEVeKLJ8MbAxrAMpg0g4p8wUekPo 1Q2x9yeDyWprg= Received: (qmail 2412559 invoked from network); 20 Sep 2021 11:05:23 +0200 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 20 Sep 2021 11:05:23 +0200 X-UD-Smtp-Session: l3s3148p1@z9vIlGnMCIsgAwDPXwlxANIWpbLKE1Uh From: Wolfram Sang To: linux-kernel@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, Wolfram Sang , Vinod Koul , Maxime Coquelin , Alexandre Torgue , dmaengine@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/9] dmaengine: stm32-dmamux: simplify getting .driver_data Date: Mon, 20 Sep 2021 11:05:13 +0200 Message-Id: <20210920090522.23784-2-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210920090522.23784-1-wsa+renesas@sang-engineering.com> References: <20210920090522.23784-1-wsa+renesas@sang-engineering.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We should get 'driver_data' from 'struct device' directly. Going via platform_device is an unneeded step back and forth. Signed-off-by: Wolfram Sang --- Build tested only. buildbot is happy. drivers/dma/stm32-dmamux.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/drivers/dma/stm32-dmamux.c b/drivers/dma/stm32-dmamux.c index a42164389ebc..175f06749df6 100644 --- a/drivers/dma/stm32-dmamux.c +++ b/drivers/dma/stm32-dmamux.c @@ -305,8 +305,7 @@ static int stm32_dmamux_probe(struct platform_device *pdev) #ifdef CONFIG_PM static int stm32_dmamux_runtime_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct stm32_dmamux_data *stm32_dmamux = platform_get_drvdata(pdev); + struct stm32_dmamux_data *stm32_dmamux = dev_get_drvdata(dev); clk_disable_unprepare(stm32_dmamux->clk); @@ -315,13 +314,12 @@ static int stm32_dmamux_runtime_suspend(struct device *dev) static int stm32_dmamux_runtime_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct stm32_dmamux_data *stm32_dmamux = platform_get_drvdata(pdev); + struct stm32_dmamux_data *stm32_dmamux = dev_get_drvdata(dev); int ret; ret = clk_prepare_enable(stm32_dmamux->clk); if (ret) { - dev_err(&pdev->dev, "failed to prepare_enable clock\n"); + dev_err(dev, "failed to prepare_enable clock\n"); return ret; } @@ -332,8 +330,7 @@ static int stm32_dmamux_runtime_resume(struct device *dev) #ifdef CONFIG_PM_SLEEP static int stm32_dmamux_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct stm32_dmamux_data *stm32_dmamux = platform_get_drvdata(pdev); + struct stm32_dmamux_data *stm32_dmamux = dev_get_drvdata(dev); int i, ret; ret = pm_runtime_resume_and_get(dev); @@ -353,8 +350,7 @@ static int stm32_dmamux_suspend(struct device *dev) static int stm32_dmamux_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct stm32_dmamux_data *stm32_dmamux = platform_get_drvdata(pdev); + struct stm32_dmamux_data *stm32_dmamux = dev_get_drvdata(dev); int i, ret; ret = pm_runtime_force_resume(dev); -- 2.30.2