From patchwork Sat Apr 14 13:06:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 10341219 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 9933A60153 for ; Sat, 14 Apr 2018 13:07:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8A10C28A83 for ; Sat, 14 Apr 2018 13:07:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7EC3D28A87; Sat, 14 Apr 2018 13:07:02 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 0E3A928A83 for ; Sat, 14 Apr 2018 13:07:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751122AbeDNNG5 (ORCPT ); Sat, 14 Apr 2018 09:06:57 -0400 Received: from mail-lf0-f68.google.com ([209.85.215.68]:40318 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750993AbeDNNGr (ORCPT ); Sat, 14 Apr 2018 09:06:47 -0400 Received: by mail-lf0-f68.google.com with SMTP id i18-v6so1076854lfc.7; Sat, 14 Apr 2018 06:06:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=S/aAsnAUFJ3e0fWQo+8+sQMeRz9BXoawTi+FtSfbHdM=; b=FopVl6H1PDCTWN1x/P5fCrIa97ZjxtxuQ//S6FbZy9gSGa1llJkhoVmXkT1KD4Ew2z XOmPZH5H/gBKRzFmB6/zwAmOa2uob8wQDkL0I4fnvMpkyp6jA6Tj3Q5D6hf6DhHtBYwH G0pBfJr3lsSG+5yisxlNky5gkwaWDC/zZjpO2EAXWPFBJWIFiS+cmV2/e6fxzr/lowpL akr05rKSBZc1oL3Rtbb0Dn/MaSH9cHZgCN53KAs/KyUrZ3MHYoAkTly1fixD5GYX3RKb 8gsTaIkkuKetbIbOubHlfT2NMl1x43ahNYRlmKQPqPiItoJhYdKB5PzDS5BuyEFHERXG XGKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=S/aAsnAUFJ3e0fWQo+8+sQMeRz9BXoawTi+FtSfbHdM=; b=BqRSDQxAixC/z+qtV8gULLvaFBixGMg/ixYDJxsUZhgdkulR1/At0qtYp0ZzPVMRrg 9e8kGvmBNTtpK/XQO837ENZU9/AfZ2SnbftOsAqrs/JrQG1MiUy5mNJaeb0TUmR8fsrQ pnuFr54XrqPdHqqvws8NpNoAxDWAaZEND7/x05q5gTJYKKh6wYQCYxJgam7UvYwZm7R1 IMeF9BXmstW5/+qRk+E+jvmAAfBipB3CSAo3sLup0Lz4VihVeBpnU1b58vCnN478msLg HaepF2glgGIOBMySGR3Ux9NaNYprZIWnSAN5RrU5hidGmkCx/hAlOFXrkYd4XZjJJjuE XGbw== X-Gm-Message-State: ALQs6tCLwLKPm9tj7idErMEqTr5bJkUKOk5758ZLwnhTk8ThrX21gyiL uyytVeiCVmWw3PXl4hPsFQg= X-Google-Smtp-Source: AIpwx4+MVQIpfcjFn783dcM3kr48nEUwda6XyYspc4X/DSL7COJnwfkHd6Rvax6L38m4qihf8vN4JQ== X-Received: by 10.46.135.6 with SMTP id m6mr5409342lji.124.1523711206150; Sat, 14 Apr 2018 06:06:46 -0700 (PDT) Received: from xi.terra (c-8bb2e655.07-184-6d6c6d4.cust.bredbandsbolaget.se. [85.230.178.139]) by smtp.gmail.com with ESMTPSA id r25sm1368699ljc.8.2018.04.14.06.06.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 14 Apr 2018 06:06:43 -0700 (PDT) Received: from johan by xi.terra with local (Exim 4.90_1) (envelope-from ) id 1f7Kt5-000646-OD; Sat, 14 Apr 2018 15:06:39 +0200 From: Johan Hovold To: Greg Kroah-Hartman , Felipe Balbi Cc: Alan Stern , Bin Liu , linux-usb@vger.kernel.org, linux-omap@vger.kernel.org, Johan Hovold Subject: [PATCH 4/6] USB: musb: omap2430: drop non-DT support Date: Sat, 14 Apr 2018 15:06:16 +0200 Message-Id: <20180414130618.23249-5-johan@kernel.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180414130618.23249-1-johan@kernel.org> References: <20180414130618.23249-1-johan@kernel.org> Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Drop support for non-DT systems, which hasn't been used by a mainline kernel since commit 9080b8dc761a ("ARM: OMAP2+: Remove legacy usb-host.c platform init code"). Specifically, since that commit usb_get_phy_dev() have always returned -ENODEV when looking up a legacy phy, something which in turn would have led to the init callback returning -EPROBE_DEFER indefinitely. Signed-off-by: Johan Hovold --- drivers/usb/musb/omap2430.c | 95 ++++++++++++++++++------------------- 1 file changed, 45 insertions(+), 50 deletions(-) diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c index 5d705930ef47..3dd6e1c5e04f 100644 --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c @@ -239,21 +239,15 @@ static int omap2430_musb_init(struct musb *musb) * up through ULPI. TWL4030-family PMICs include one, * which needs a driver, drivers aren't always needed. */ - if (dev->parent->of_node) { - musb->phy = devm_phy_get(dev->parent, "usb2-phy"); - - /* We can't totally remove musb->xceiv as of now because - * musb core uses xceiv.state and xceiv.otg. Once we have - * a separate state machine to handle otg, these can be moved - * out of xceiv and then we can start using the generic PHY - * framework - */ - musb->xceiv = devm_usb_get_phy_by_phandle(dev->parent, - "usb-phy", 0); - } else { - musb->xceiv = devm_usb_get_phy_dev(dev, 0); - musb->phy = devm_phy_get(dev, "usb"); - } + musb->phy = devm_phy_get(dev->parent, "usb2-phy"); + + /* We can't totally remove musb->xceiv as of now because + * musb core uses xceiv.state and xceiv.otg. Once we have + * a separate state machine to handle otg, these can be moved + * out of xceiv and then we can start using the generic PHY + * framework + */ + musb->xceiv = devm_usb_get_phy_by_phandle(dev->parent, "usb-phy", 0); if (IS_ERR(musb->xceiv)) { status = PTR_ERR(musb->xceiv); @@ -391,8 +385,13 @@ static int omap2430_probe(struct platform_device *pdev) struct omap2430_glue *glue; struct device_node *np = pdev->dev.of_node; struct musb_hdrc_config *config; + struct device_node *control_node; + struct platform_device *control_pdev; int ret = -ENOMEM, val; + if (!np) + return -ENODEV; + glue = devm_kzalloc(&pdev->dev, sizeof(*glue), GFP_KERNEL); if (!glue) goto err0; @@ -412,47 +411,43 @@ static int omap2430_probe(struct platform_device *pdev) glue->status = MUSB_UNKNOWN; glue->control_otghs = ERR_PTR(-ENODEV); - if (np) { - struct device_node *control_node; - struct platform_device *control_pdev; + pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); + if (!pdata) + goto err2; - pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); - if (!pdata) - goto err2; + data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL); + if (!data) + goto err2; - data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL); - if (!data) - goto err2; + config = devm_kzalloc(&pdev->dev, sizeof(*config), GFP_KERNEL); + if (!config) + goto err2; - config = devm_kzalloc(&pdev->dev, sizeof(*config), GFP_KERNEL); - if (!config) + of_property_read_u32(np, "mode", (u32 *)&pdata->mode); + of_property_read_u32(np, "interface-type", + (u32 *)&data->interface_type); + of_property_read_u32(np, "num-eps", (u32 *)&config->num_eps); + of_property_read_u32(np, "ram-bits", (u32 *)&config->ram_bits); + of_property_read_u32(np, "power", (u32 *)&pdata->power); + + ret = of_property_read_u32(np, "multipoint", &val); + if (!ret && val) + config->multipoint = true; + + pdata->board_data = data; + pdata->config = config; + + control_node = of_parse_phandle(np, "ctrl-module", 0); + if (control_node) { + control_pdev = of_find_device_by_node(control_node); + if (!control_pdev) { + dev_err(&pdev->dev, "Failed to get control device\n"); + ret = -EINVAL; goto err2; - - of_property_read_u32(np, "mode", (u32 *)&pdata->mode); - of_property_read_u32(np, "interface-type", - (u32 *)&data->interface_type); - of_property_read_u32(np, "num-eps", (u32 *)&config->num_eps); - of_property_read_u32(np, "ram-bits", (u32 *)&config->ram_bits); - of_property_read_u32(np, "power", (u32 *)&pdata->power); - - ret = of_property_read_u32(np, "multipoint", &val); - if (!ret && val) - config->multipoint = true; - - pdata->board_data = data; - pdata->config = config; - - control_node = of_parse_phandle(np, "ctrl-module", 0); - if (control_node) { - control_pdev = of_find_device_by_node(control_node); - if (!control_pdev) { - dev_err(&pdev->dev, "Failed to get control device\n"); - ret = -EINVAL; - goto err2; - } - glue->control_otghs = &control_pdev->dev; } + glue->control_otghs = &control_pdev->dev; } + pdata->platform_ops = &omap2430_ops; platform_set_drvdata(pdev, glue);