From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757988AbcJZJb0 (ORCPT ); Wed, 26 Oct 2016 05:31:26 -0400 Received: from mail-wm0-f52.google.com ([74.125.82.52]:35360 "EHLO mail-wm0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757366AbcJZJbV (ORCPT ); Wed, 26 Oct 2016 05:31:21 -0400 Subject: Re: [PATCH 3/4] usb: musb: da8xx: Add DT support for the DA8xx driver To: Sergei Shtylyov , khilman@baylibre.com, robh+dt@kernel.org, b-liu@ti.com References: <1477406345-27192-1-git-send-email-abailon@baylibre.com> <1477406345-27192-4-git-send-email-abailon@baylibre.com> <82a39c63-8486-de00-3a0f-8d9d267b6404@cogentembedded.com> Cc: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Petr Kulhavy From: Alexandre Bailon Message-ID: <5ae4c10c-a0a3-3cd7-d30a-4bae6920b4af@baylibre.com> Date: Wed, 26 Oct 2016 11:31:18 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <82a39c63-8486-de00-3a0f-8d9d267b6404@cogentembedded.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/25/2016 07:38 PM, Sergei Shtylyov wrote: > Hello. > > On 10/25/2016 05:39 PM, Alexandre Bailon wrote: > >> From: Petr Kulhavy >> >> This adds DT support for TI DA8xx/OMAP-L1x/AM17xx/AM18xx MUSB driver >> >> Signed-off-by: Petr Kulhavy >> Signed-off-by: Alexandre Bailon >> --- >> drivers/usb/musb/da8xx.c | 76 >> ++++++++++++++++++++++++++++++++++++++++++------ >> 1 file changed, 67 insertions(+), 9 deletions(-) >> >> diff --git a/drivers/usb/musb/da8xx.c b/drivers/usb/musb/da8xx.c >> index 210b7e4..d465087 100644 >> --- a/drivers/usb/musb/da8xx.c >> +++ b/drivers/usb/musb/da8xx.c >> @@ -6,6 +6,9 @@ >> * Based on the DaVinci "glue layer" code. >> * Copyright (C) 2005-2006 by Texas Instruments >> * >> + * DT support >> + * Copyright (c) 2016 Petr Kulhavy >> + * >> * This file is part of the Inventra Controller Driver for Linux. >> * >> * The Inventra Controller Driver for Linux is free software; you > [...] >> @@ -499,15 +537,21 @@ static int da8xx_probe(struct platform_device >> *pdev) >> memset(musb_resources, 0x00, sizeof(*musb_resources) * >> ARRAY_SIZE(musb_resources)); >> >> - musb_resources[0].name = pdev->resource[0].name; >> - musb_resources[0].start = pdev->resource[0].start; >> - musb_resources[0].end = pdev->resource[0].end; >> - musb_resources[0].flags = pdev->resource[0].flags; >> + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); >> + if (!res) { >> + dev_err(&pdev->dev, "failed to get memory.\n"); >> + ret = -EINVAL; >> + goto err_unregister_usb_phy; >> + } >> + musb_resources[0] = *res; > > What does this change have to do with the DT conversion? Nothing. I will remove it. > >> >> - musb_resources[1].name = pdev->resource[1].name; >> - musb_resources[1].start = pdev->resource[1].start; >> - musb_resources[1].end = pdev->resource[1].end; >> - musb_resources[1].flags = pdev->resource[1].flags; >> + res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); >> + if (!res) { >> + dev_err(&pdev->dev, "failed to get irq.\n"); >> + ret = -EINVAL; >> + goto err_unregister_usb_phy; >> + } >> + musb_resources[1] = *res; > > And this? > I'm also concerned that you'd copy the resource linkage fields which > the existing code avoids... > > [...] > > MBR, Sergei >