From patchwork Wed May 16 13:17:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 914627 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=monstr-eu.20150623.gappssmtp.com header.i=@monstr-eu.20150623.gappssmtp.com header.b="ZehIxoEm"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 40mFP12V5Rz9s19 for ; Wed, 16 May 2018 23:18:11 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id AF0B1C21EC2; Wed, 16 May 2018 13:18:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 0F4C6C21D74; Wed, 16 May 2018 13:18:05 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 826F0C21D74; Wed, 16 May 2018 13:18:03 +0000 (UTC) Received: from mail-wr0-f193.google.com (mail-wr0-f193.google.com [209.85.128.193]) by lists.denx.de (Postfix) with ESMTPS id 13CDEC21C27 for ; Wed, 16 May 2018 13:18:03 +0000 (UTC) Received: by mail-wr0-f193.google.com with SMTP id 94-v6so1095030wrf.5 for ; Wed, 16 May 2018 06:18:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20150623.gappssmtp.com; s=20150623; h=sender:from:to:cc:subject:date:message-id; bh=5SfnLmU8oUT7msE3IsuX6F76tbYLwEoWIcNgAOFBTjE=; b=ZehIxoEmC0NsZJHldel/hGvouYeDEaNyEDzJlna2ri+KzQEu7PBcsyMdGLlv871+Fd VbcM5srbmKJimtEAdu3RTL1eDw1ANrPH+CgZzUeprJAXGkrmKSMUnGpuu2pg2KHfr99u cLIigP8CuNTnYnOc4FL8L0kB6Ny12a/y/QnwfbXG3cHrT1KRz2s8tgWRXMfcDCPwA5cg WWPDqprq1f08PzIQv99hpJvjbgSG8mleVq1e6mKnbHzOjcvnvC5Ce/8fGDUdDgNl5Lnj Az+vgkdA2Bsds5pExkP1zZ7CoqwdGY2Bxbwqp7x70EzgUko7303vIKdddT+TwMImsI9A NBgw== 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; bh=5SfnLmU8oUT7msE3IsuX6F76tbYLwEoWIcNgAOFBTjE=; b=Tednec5YtwUVVLZvcnhwxiVHKsv+48ARVedLGK99T9igEiMC/sl8FxtSAq0FpLWZGy Lab2BufQpUqEhDKIPKgwum0bgyTDPSzTdcT22Irl2tGYUbF2jOW09DOP//yLDL6Pilb8 ugj8l2NtROSMDiagol1p0sujkWSfh54Rqc/z8YUjQ0QE6nWukRjRnmxRyPYGZb6taWlR jm53LOOq38qZ7jMl/ZLQdrSMGamUeVVJTrTvVmXxpCxpekGUzzY301LU1C9n/ZWfuo5U hwU6kLhnr9QUojplxaxBvu+uvQkTZvcRG4+ly9lrGufuRgMSFVBqqVcE2s96pspXtiMA OH5Q== X-Gm-Message-State: ALKqPwcqULkOGHIrH2YInED0CxBUzMcxv/Sc/BpJWzA7OWniS/qzWnKw J70fXhoTMh5yp0F3rWE4SVMl9YdO X-Google-Smtp-Source: AB8JxZpgshJn4B5XHbS9UDbJ1n8o2VN/qH3FmoSO5i+la9KEKJDQUfBW118WZEInU0alvMjk+O+NPQ== X-Received: by 2002:adf:af28:: with SMTP id z37-v6mr832978wrc.72.1526476682328; Wed, 16 May 2018 06:18:02 -0700 (PDT) Received: from localhost (nat-35.starnet.cz. [178.255.168.35]) by smtp.gmail.com with ESMTPSA id w5-v6sm3298916wmd.26.2018.05.16.06.18.01 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Wed, 16 May 2018 06:18:01 -0700 (PDT) From: Michal Simek To: u-boot@lists.denx.de Date: Wed, 16 May 2018 15:17:57 +0200 Message-Id: X-Mailer: git-send-email 2.17.0 Cc: Marek Vasut , Mugunthan V N Subject: [U-Boot] [PATCH] drivers: usb: dwc3: remove devm_zalloc from linux_compact X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: Mugunthan V N devm_zalloc() is already defined in dm/device.h header, so devm_zalloc can be removed from linux_compact.h beader file. Signed-off-by: Mugunthan V N Signed-off-by: Michal Simek --- Taken from https://patchwork.ozlabs.org/patch/775108/ "linux-compat.h is local to dwc3 folder where as dm/device.h is available globally. My understanding is linux-compat.h is to define functions/wrappers needed by dwc3 part picked from linux that are not yet directly available in U-Boot. But, given that devm_kzalloc() is provided in U-Boot, I thought it would be better to get rid of definition in linux-compat.h in order to avoid conflicting definition error." --- drivers/usb/dwc3/core.c | 7 +++++-- drivers/usb/dwc3/dwc3-omap.c | 2 +- drivers/usb/dwc3/linux-compat.h | 5 ----- drivers/usb/dwc3/ti_usb_phy.c | 1 + 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 7a91015048f5..dbdad22d1134 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -110,7 +111,8 @@ static struct dwc3_event_buffer *dwc3_alloc_one_event_buffer(struct dwc3 *dwc, { struct dwc3_event_buffer *evt; - evt = devm_kzalloc(dwc->dev, sizeof(*evt), GFP_KERNEL); + evt = devm_kzalloc((struct udevice *)dwc->dev, sizeof(*evt), + GFP_KERNEL); if (!evt) return ERR_PTR(-ENOMEM); @@ -623,7 +625,8 @@ int dwc3_uboot_init(struct dwc3_device *dwc3_dev) void *mem; - mem = devm_kzalloc(dev, sizeof(*dwc) + DWC3_ALIGN_MASK, GFP_KERNEL); + mem = devm_kzalloc((struct udevice *)dev, + sizeof(*dwc) + DWC3_ALIGN_MASK, GFP_KERNEL); if (!mem) return -ENOMEM; diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c index 64822ee73991..41b061241fe1 100644 --- a/drivers/usb/dwc3/dwc3-omap.c +++ b/drivers/usb/dwc3/dwc3-omap.c @@ -376,7 +376,7 @@ int dwc3_omap_uboot_init(struct dwc3_omap_device *omap_dev) struct device *dev = NULL; struct dwc3_omap *omap; - omap = devm_kzalloc(dev, sizeof(*omap), GFP_KERNEL); + omap = devm_kzalloc((struct udevice *)dev, sizeof(*omap), GFP_KERNEL); if (!omap) return -ENOMEM; diff --git a/drivers/usb/dwc3/linux-compat.h b/drivers/usb/dwc3/linux-compat.h index 27ae21247b13..35850f91a36d 100644 --- a/drivers/usb/dwc3/linux-compat.h +++ b/drivers/usb/dwc3/linux-compat.h @@ -20,9 +20,4 @@ static inline size_t strlcat(char *dest, const char *src, size_t n) return strlen(dest) + strlen(src); } -static inline void *devm_kzalloc(struct device *dev, unsigned int size, - unsigned int flags) -{ - return kzalloc(size, flags); -} #endif diff --git a/drivers/usb/dwc3/ti_usb_phy.c b/drivers/usb/dwc3/ti_usb_phy.c index 925f56c97c81..d168e868e35e 100644 --- a/drivers/usb/dwc3/ti_usb_phy.c +++ b/drivers/usb/dwc3/ti_usb_phy.c @@ -23,6 +23,7 @@ #include #include #include +#include #include "linux-compat.h"