From patchwork Sat Nov 12 10:39:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolae Rosia X-Patchwork-Id: 9424049 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BC4AE60476 for ; Sat, 12 Nov 2016 10:40:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ACB1A2960D for ; Sat, 12 Nov 2016 10:40:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A19CE296B8; Sat, 12 Nov 2016 10:40:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5C0952960D for ; Sat, 12 Nov 2016 10:40:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753823AbcKLKkK (ORCPT ); Sat, 12 Nov 2016 05:40:10 -0500 Received: from relay1.mentorg.com ([192.94.38.131]:42455 "EHLO relay1.mentorg.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752448AbcKLKkJ (ORCPT ); Sat, 12 Nov 2016 05:40:09 -0500 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-01.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1c5VjD-0006PI-K5 from Nicolae_Rosia@mentor.com ; Sat, 12 Nov 2016 02:40:07 -0800 Received: from rosia.mgc (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.3.224.2; Sat, 12 Nov 2016 10:40:03 +0000 From: Nicolae Rosia To: Kishon Vijay Abraham I CC: , Felipe Balbi , Greg Kroah-Hartman , , , Tony Lindgren , Nicolae Rosia Subject: [PATCH] phy: twl4030-usb: make driver DT only Date: Sat, 12 Nov 2016 12:39:51 +0200 Message-ID: <1478947191-30532-1-git-send-email-Nicolae_Rosia@mentor.com> X-Mailer: git-send-email 2.5.5 MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP All users are DT-only and it makes no sense to keep unused code Signed-off-by: Nicolae Rosia --- drivers/phy/Kconfig | 1 + drivers/phy/phy-twl4030-usb.c | 22 +++++++--------------- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig index fe00f91..265391e 100644 --- a/drivers/phy/Kconfig +++ b/drivers/phy/Kconfig @@ -196,6 +196,7 @@ config TWL4030_USB depends on TWL4030_CORE && REGULATOR_TWL4030 && USB_MUSB_OMAP2PLUS depends on USB_SUPPORT depends on USB_GADGET || !USB_GADGET # if USB_GADGET=m, this can't 'y' + depends on OF select GENERIC_PHY select USB_PHY help diff --git a/drivers/phy/phy-twl4030-usb.c b/drivers/phy/phy-twl4030-usb.c index 87e6334..a5e4927 100644 --- a/drivers/phy/phy-twl4030-usb.c +++ b/drivers/phy/phy-twl4030-usb.c @@ -656,7 +656,6 @@ static const struct dev_pm_ops twl4030_usb_pm_ops = { static int twl4030_usb_probe(struct platform_device *pdev) { - struct twl4030_usb_data *pdata = dev_get_platdata(&pdev->dev); struct twl4030_usb *twl; struct phy *phy; int status, err; @@ -664,19 +663,17 @@ static int twl4030_usb_probe(struct platform_device *pdev) struct device_node *np = pdev->dev.of_node; struct phy_provider *phy_provider; + if (!np) { + dev_err(&pdev->dev, "no DT info\n"); + return -EINVAL; + } + twl = devm_kzalloc(&pdev->dev, sizeof(*twl), GFP_KERNEL); if (!twl) return -ENOMEM; - if (np) - of_property_read_u32(np, "usb_mode", - (enum twl4030_usb_mode *)&twl->usb_mode); - else if (pdata) { - twl->usb_mode = pdata->usb_mode; - } else { - dev_err(&pdev->dev, "twl4030 initialized without pdata\n"); - return -EINVAL; - } + of_property_read_u32(np, "usb_mode", + (enum twl4030_usb_mode *)&twl->usb_mode); otg = devm_kzalloc(&pdev->dev, sizeof(*otg), GFP_KERNEL); if (!otg) @@ -750,11 +747,6 @@ static int twl4030_usb_probe(struct platform_device *pdev) return status; } - if (pdata) - err = phy_create_lookup(phy, "usb", "musb-hdrc.0"); - if (err) - return err; - pm_runtime_mark_last_busy(&pdev->dev); pm_runtime_put_autosuspend(twl->dev);