From patchwork Thu Jul 22 02:42:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 483853 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp6762837jao; Wed, 21 Jul 2021 19:44:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxjQg+ED8PJ1zuZAjONlqJwuZhZ5hyBApcGru3UciC/PuW93Xck+2fDnphfvLktf5g+eE7Z X-Received: by 2002:a6b:e417:: with SMTP id u23mr17910151iog.91.1626921858512; Wed, 21 Jul 2021 19:44:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626921858; cv=none; d=google.com; s=arc-20160816; b=cytZNhy4Nh8W8KJi22pkFbKoZLix6GLOurTl4us9Qdjtw5+hRf6qllDIlU4onNZ1Pw 5qJwdkxBvPWNk2GODmYKDWZ27FHUPG4/dLUE1lmkh6QltdtxTpezyh/Dftenw6kd58DV ykkxsDZCUTJhDarly4QTHW6qhzv1I8DTYxTLhYhf1V/0+lUvIIN1frZIijxeSLt9mfqD ONAp7xkSTFdEv+20mHyUpS6GAeQXv6bUpHdDsCM70D95+QecksG1YOZ8dVg8hZOakHzB FesK38dHGWXu3Zd6c3lTAwuzFZiNL6IDOP7tZkIElZzPIXH6iVqOI+Rlq3AGh01GOwks OxyA== 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=xKV8hlv55ixpHr/xWlsCOYWKdqHbAXYcZUW9Pc8iaEA=; b=Nx4WSgj2BD1nWU60QDCAH/IuTJ6nxOBBBwbmp9091XaWA23PaiWVotJp9JX2GnIu4G cMLul1q1yFz8QEzmXbfvKvh2ruAgSqK911pGPhJni6kvA9pkCaV9YPCwArkt9mW3FSOS noKRi9Pzu1bNKDORE4nmJ246SMGrmaBo0wsXj6aKgj46apLIElm2iSixGtHJakzFoRnF nveQT+DtjMpAWRAnCBa3SPxF4QVZqo7n/q6iw5s0hgiGCcEPB92iMjoPUk9dkwDZK4b+ 76YmAJz+OSamiTMNreiiiz3EqHZVFCg/G7XwGvCW7SQ6ycSEu3rmc1hcBsUjXMJ9QkJz bnCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IzorDbfi; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z7si1358727ilq.32.2021.07.21.19.44.18; Wed, 21 Jul 2021 19:44:18 -0700 (PDT) Received-SPF: pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IzorDbfi; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230473AbhGVCDl (ORCPT + 7 others); Wed, 21 Jul 2021 22:03:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230429AbhGVCDh (ORCPT ); Wed, 21 Jul 2021 22:03:37 -0400 Received: from mail-ot1-x32d.google.com (mail-ot1-x32d.google.com [IPv6:2607:f8b0:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 829D2C0613C1 for ; Wed, 21 Jul 2021 19:44:13 -0700 (PDT) Received: by mail-ot1-x32d.google.com with SMTP id b18-20020a0568303112b02904cf73f54f4bso1020772ots.2 for ; Wed, 21 Jul 2021 19:44:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xKV8hlv55ixpHr/xWlsCOYWKdqHbAXYcZUW9Pc8iaEA=; b=IzorDbfi4J0yK4IdHULCR9qAHRjagqRlo6FFdpjHS7e93tP4y2cMxhtOq10k2Q6UeG iKYKYCdOeywdHLcHZxMvShzyMfyfyQqGP3Sbz+p9+G9DdXGxhbaU/HrLQTx96yIkSv3J FCyf3M+5Pz9QjvPfcF1ty/BbOKehfRG5cqA4/8KISGEr1xVXTNUIt+1lAskvVEvH9rx/ A83k/59flfuGg7xGbZtupKhEiYBu298i9zP6i/xhN1JDUpqh7F7tQ2kPuQlc9I6uaV9I i4lfLaUL5LRwClSPU52CW4ZfwQ5bVw9IMwbzfa7UG9rMyHbSw81rWdYbByjVixj7oq4D s4QQ== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=xKV8hlv55ixpHr/xWlsCOYWKdqHbAXYcZUW9Pc8iaEA=; b=VZ0gQ60GqRUPEHzzr80zSWr5GKl1RuGiBG5Qcwe020UAcp9jtVNAw9pZdBkLl1fXVR Y5upt9+7NT834tnqGxiU+j01MN/DnXYe92dCIYyWH+8ZVeMOAuHx2ALx/p8o7drPyYCt 9oA7ZTHQx7Oq5uOiOJnJfdxOWWMZHeT8DMQPhu388jl11ywhAyuDsj7FLx1s+PK9QVBu ClZhgRpOGl59TfoEy/Wj6Hio6amk4D84laIDVSyVY+RQZ7GAAeuoY4uY2XF/XXxgSz5g mlZvfniumSOZ0zIdyR1XRf0BNOphEIcXwlDPVeGMTWgjs/OxNHMc+n8SenIs5mM58VMN aFyA== X-Gm-Message-State: AOAM531IpGFNG0IHqJavrYscxWcxhagB65GHWirGdxIgrKH2wX7HZPwv L+gV0SfHoTKe7qHOi+amKb59Tg== X-Received: by 2002:a05:6830:2786:: with SMTP id x6mr25286903otu.359.1626921852888; Wed, 21 Jul 2021 19:44:12 -0700 (PDT) Received: from localhost.localdomain (104-57-184-186.lightspeed.austtx.sbcglobal.net. [104.57.184.186]) by smtp.gmail.com with ESMTPSA id u18sm5346519oif.9.2021.07.21.19.44.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Jul 2021 19:44:12 -0700 (PDT) From: Bjorn Andersson To: Rob Clark , Sean Paul , David Airlie , Daniel Vetter , Rob Herring , Stephen Boyd , Abhinav Kumar Cc: Kuogee Hsieh , Tanmay Shah , Chandan Uddaraju , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/5] drm/msm/dp: Use devres for ioremap() Date: Wed, 21 Jul 2021 19:42:24 -0700 Message-Id: <20210722024227.3313096-3-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210722024227.3313096-1-bjorn.andersson@linaro.org> References: <20210722024227.3313096-1-bjorn.andersson@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The non-devres version of ioremap is used, which requires manual cleanup. But the code paths leading here is mixed with other devres users, so rely on this for ioremap as well to simplify the code. Signed-off-by: Bjorn Andersson --- drivers/gpu/drm/msm/dp/dp_parser.c | 29 ++++------------------------- 1 file changed, 4 insertions(+), 25 deletions(-) -- 2.29.2 Reviewed-by: Stephen Boyd Reviewed-by: Abhinav Kumar diff --git a/drivers/gpu/drm/msm/dp/dp_parser.c b/drivers/gpu/drm/msm/dp/dp_parser.c index 0519dd3ac3c3..c064ced78278 100644 --- a/drivers/gpu/drm/msm/dp/dp_parser.c +++ b/drivers/gpu/drm/msm/dp/dp_parser.c @@ -32,7 +32,7 @@ static int msm_dss_ioremap(struct platform_device *pdev, } io_data->len = (u32)resource_size(res); - io_data->base = ioremap(res->start, io_data->len); + io_data->base = devm_ioremap(&pdev->dev, res->start, io_data->len); if (!io_data->base) { DRM_ERROR("%pS->%s: ioremap failed\n", __builtin_return_address(0), __func__); @@ -42,22 +42,6 @@ static int msm_dss_ioremap(struct platform_device *pdev, return 0; } -static void msm_dss_iounmap(struct dss_io_data *io_data) -{ - if (io_data->base) { - iounmap(io_data->base); - io_data->base = NULL; - } - io_data->len = 0; -} - -static void dp_parser_unmap_io_resources(struct dp_parser *parser) -{ - struct dp_io *io = &parser->io; - - msm_dss_iounmap(&io->dp_controller); -} - static int dp_parser_ctrl_res(struct dp_parser *parser) { int rc = 0; @@ -67,19 +51,14 @@ static int dp_parser_ctrl_res(struct dp_parser *parser) rc = msm_dss_ioremap(pdev, &io->dp_controller); if (rc) { DRM_ERROR("unable to remap dp io resources, rc=%d\n", rc); - goto err; + return rc; } io->phy = devm_phy_get(&pdev->dev, "dp"); - if (IS_ERR(io->phy)) { - rc = PTR_ERR(io->phy); - goto err; - } + if (IS_ERR(io->phy)) + return PTR_ERR(io->phy); return 0; -err: - dp_parser_unmap_io_resources(parser); - return rc; } static int dp_parser_misc(struct dp_parser *parser)