From patchwork Fri Feb 27 04:34:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 5897741 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 069299F536 for ; Fri, 27 Feb 2015 04:34:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2CEF22020F for ; Fri, 27 Feb 2015 04:34:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 587692020E for ; Fri, 27 Feb 2015 04:34:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753352AbbB0EeQ (ORCPT ); Thu, 26 Feb 2015 23:34:16 -0500 Received: from mail-pa0-f52.google.com ([209.85.220.52]:35908 "EHLO mail-pa0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753279AbbB0EeP (ORCPT ); Thu, 26 Feb 2015 23:34:15 -0500 Received: by pabli10 with SMTP id li10so3550878pab.3 for ; Thu, 26 Feb 2015 20:34:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:subject:from:to:cc:date:content-type :mime-version:content-transfer-encoding; bh=5rdY+YYObmflUbUggqEkO4nNbIz45PrKxpQgXseojjA=; b=QXGtHF5act9+1W4kbpkPkLgD2TTERAcB2Itao2bfu3+eDAe19b062BDscT6m1fpVpB H4HMt7hwVKUW2U+2owU8QeZcsJz3A/8OX1xkKW0eL4Y8C8RGBr7kWKI0ZApQLIcdp2YC /wtcyWPH3Laf9zZeCoE+Qfna8sOuQvqMDOJ88BQ0w6Vp/bMcHWugzx1AZwiRnf62SXIf +AoXYbMUJj4HF2IjhlQlCYNG4X69K4f32X4udM1DGQ+bsJPbDdByVDN6Gg44hhtZjJTc lKvSm0LUF0y4kzqoN3qgd6WYP386yvDAQGRyh8nL8xcBOAZbLd7+qDBaL4jKs5cNuXoc bPVw== X-Gm-Message-State: ALoCoQmPetbHKy1xAZXYfvUor2OxdYyI6NBSbcwT0huTQBoKaC7ZvtcW2bzfewxPb+d2WRVqg1uC X-Received: by 10.66.141.71 with SMTP id rm7mr20400370pab.114.1425011655095; Thu, 26 Feb 2015 20:34:15 -0800 (PST) Received: from [192.168.0.104] (218-164-128-147.dynamic.hinet.net. [218.164.128.147]) by mx.google.com with ESMTPSA id g3sm2494634pdg.39.2015.02.26.20.34.12 (version=TLSv1.2 cipher=AES128-GCM-SHA256 bits=128/128); Thu, 26 Feb 2015 20:34:14 -0800 (PST) Message-ID: <1425011650.23256.1.camel@phoenix> Subject: [PATCH] phy: exynos-dp-video: Kill exynos_dp_video_phy_pwr_isol function From: Axel Lin To: Kishon Vijay Abraham I Cc: Jingoo Han , linux-kernel@vger.kernel.org, "linux-samsung-soc@vger.kernel.org" Date: Fri, 27 Feb 2015 12:34:10 +0800 X-Mailer: Evolution 3.10.4-0ubuntu2 Mime-Version: 1.0 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If IS_ERR(state->regs) the .probe fails. So IS_ERR(state->regs) test in exynos_dp_video_phy_pwr_isol() is not necessary. exynos_dp_video_phy_pwr_isol() simply does a regmap_update_bits() call now, just call regmap_update_bits() instead and return proper return value. Signed-off-by: Axel Lin Reviewed-by: Sylwester Nawrocki --- drivers/phy/phy-exynos-dp-video.c | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/drivers/phy/phy-exynos-dp-video.c b/drivers/phy/phy-exynos-dp-video.c index f86cbe6..179cbf9 100644 --- a/drivers/phy/phy-exynos-dp-video.c +++ b/drivers/phy/phy-exynos-dp-video.c @@ -30,28 +30,13 @@ struct exynos_dp_video_phy { const struct exynos_dp_video_phy_drvdata *drvdata; }; -static void exynos_dp_video_phy_pwr_isol(struct exynos_dp_video_phy *state, - unsigned int on) -{ - unsigned int val; - - if (IS_ERR(state->regs)) - return; - - val = on ? 0 : EXYNOS5_PHY_ENABLE; - - regmap_update_bits(state->regs, state->drvdata->phy_ctrl_offset, - EXYNOS5_PHY_ENABLE, val); -} - static int exynos_dp_video_phy_power_on(struct phy *phy) { struct exynos_dp_video_phy *state = phy_get_drvdata(phy); /* Disable power isolation on DP-PHY */ - exynos_dp_video_phy_pwr_isol(state, 0); - - return 0; + return regmap_update_bits(state->regs, state->drvdata->phy_ctrl_offset, + EXYNOS5_PHY_ENABLE, EXYNOS5_PHY_ENABLE); } static int exynos_dp_video_phy_power_off(struct phy *phy) @@ -59,9 +44,8 @@ static int exynos_dp_video_phy_power_off(struct phy *phy) struct exynos_dp_video_phy *state = phy_get_drvdata(phy); /* Enable power isolation on DP-PHY */ - exynos_dp_video_phy_pwr_isol(state, 1); - - return 0; + return regmap_update_bits(state->regs, state->drvdata->phy_ctrl_offset, + EXYNOS5_PHY_ENABLE, 0); } static struct phy_ops exynos_dp_video_phy_ops = {