Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp105362ybl; Tue, 7 Jan 2020 15:06:32 -0800 (PST) X-Google-Smtp-Source: APXvYqw8jh9OtkqirguQ0K/bVsMBGhwodotK3QaJuvXWO86Q242EaHHTovtniutX6Ri4aEZ5I3Ay X-Received: by 2002:a9d:74c4:: with SMTP id a4mr2028361otl.119.1578438392502; Tue, 07 Jan 2020 15:06:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578438392; cv=none; d=google.com; s=arc-20160816; b=LZ+subAhZOigpWi5i2nibcf0GOED6G33fTGj9RZvOOYi+g6NylPOFttcbU0YfSsioR 74tNqvDLqoa2lMcyEkvej/ke4GSpjjqHnHB0w2e46VAfXtUzuyYgBlFczeaxzvZijt1K 3eb7sM/T0zDlhw15fmJpPnwlIt+QaPVb+zELEq/BRIyli8G/iC2NaJoIxiYiSjaO5nb0 wTrn+TtlbYa35kBfTrJDM+Ne7UinnLLccXh6irnBz8wlayP93Nm+FVrX6RdFMzzStKEZ 2+HDoaYXzum1Zp8s1a3Giy58zSHovD1VPJAXNz+qrvEK/xZlZTRc4rat+G0if4b+X65E 7kBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=ysTac7cnTru/zE8rEjwv7g+oembA3MfbbfXUeVXm7SQ=; b=Mzy7UdlHXycoliHDO11dCuHDqBYkEAFcZwBJ1C/xphOQiRt7RJlTIcIhhTfOE8Juiw bBbJV6Zu/N1LvRzWLLJ+/upKjCxZp8pfcfQazXvuPLrB8nACz0NgWf9yzUuGeXS1f8PU rOBeyPx24h/Qu4yELqKaRqBirdYE0dDDhRBIzFEDAZ8a7ZvfBY2aW552dgo4bqhQC2vg RpkkrWXzp7U4alg5YJIG3rzvjHT75hSSSYfBFtGLL+8A3xLCUR4G+a8Oc5aUqxlgPDQf hN+zYjvw/mSIFlAthfoF1J0OgY01Z7TAHSr5BJYx1Fezr92R0ltP3GDcUGK6rlHBhBWj v/vA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="KGXTtl/x"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d3si791754oia.236.2020.01.07.15.06.20; Tue, 07 Jan 2020 15:06:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="KGXTtl/x"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727471AbgAGXEY (ORCPT + 99 others); Tue, 7 Jan 2020 18:04:24 -0500 Received: from mail.kernel.org ([198.145.29.99]:34012 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727077AbgAGXEY (ORCPT ); Tue, 7 Jan 2020 18:04:24 -0500 Received: from mail-qk1-f179.google.com (mail-qk1-f179.google.com [209.85.222.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 599CB2072A; Tue, 7 Jan 2020 23:04:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578438263; bh=zKdukV38l1KtyXdcWoPM86hXcKY/+oxlv2OrUMNI2vE=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=KGXTtl/x+Q6PPjHP8G3bFP+QfBF+JvWyTeZyG79qarhp5mMcFBzpm5js0OpxdJ2cD BoColFbUccjeZ1H6QTqU/twgYno0hGc8+zlUp3+pB6ykVJsPcB5ERfOzA8soTA/67Q K1px87lnvxqP9mtIEOVnkwzPvBCH9xacOIl5XdtQ= Received: by mail-qk1-f179.google.com with SMTP id j9so1050345qkk.1; Tue, 07 Jan 2020 15:04:23 -0800 (PST) X-Gm-Message-State: APjAAAVzkQtbOlZvqiNUW14iU8x/+mfo/7a/F+2467PNOZthzxD0TdLV ujt10Z+yRvEMqHmobF4Pr9tsmE6AcR3p3af6Ow== X-Received: by 2002:a05:620a:135b:: with SMTP id c27mr1538529qkl.119.1578438262529; Tue, 07 Jan 2020 15:04:22 -0800 (PST) MIME-Version: 1.0 References: <20200107220938.2412463-1-arnd@arndb.de> In-Reply-To: <20200107220938.2412463-1-arnd@arndb.de> From: Rob Herring Date: Tue, 7 Jan 2020 17:04:11 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] of: add dummy of_platform_device_destroy To: Arnd Bergmann Cc: Frank Rowand , Jyri Sarha , Kishon Vijay Abraham I , devicetree@vger.kernel.org, "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 7, 2020 at 4:09 PM Arnd Bergmann wrote: > > The new phy-j721e-wiz driver causes a link failure without CONFIG_OF: > > drivers/phy/ti/phy-j721e-wiz.o: In function `wiz_remove': > phy-j721e-wiz.c:(.text+0x40): undefined reference to `of_platform_device_destroy' > > Add a dummy version of this function to avoid having to add Kconfig > dependencies for the driver. > > Fixes: 42440de5438a ("phy: ti: j721e-wiz: Add support for WIZ module present in TI J721E SoC") > Signed-off-by: Arnd Bergmann > --- > include/linux/of_platform.h | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h > index 84a966623e78..2551c263e57d 100644 > --- a/include/linux/of_platform.h > +++ b/include/linux/of_platform.h > @@ -54,11 +54,16 @@ extern struct platform_device *of_device_alloc(struct device_node *np, > struct device *parent); > #ifdef CONFIG_OF > extern struct platform_device *of_find_device_by_node(struct device_node *np); > +extern int of_platform_device_destroy(struct device *dev, void *data); This is already declared, so don't you want to remove the existing one. > #else > static inline struct platform_device *of_find_device_by_node(struct device_node *np) > { > return NULL; > } > +static inline int of_platform_device_destroy(struct device *dev, void *data) > +{ > + return 0; > +} I'm curious why this is needed, but of_platform_device_create() is not? > #endif > > /* Platform devices and busses creation */ > -- > 2.20.0 >