From patchwork Tue Apr 28 03:59:39 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Grant Likely X-Patchwork-Id: 26526 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id EF0B7B7069 for ; Tue, 28 Apr 2009 13:59:57 +1000 (EST) Received: by ozlabs.org (Postfix) id DCA5FDDDB6; Tue, 28 Apr 2009 13:59:57 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 65AA2DDD01 for ; Tue, 28 Apr 2009 13:59:57 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752676AbZD1D7z (ORCPT ); Mon, 27 Apr 2009 23:59:55 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755345AbZD1D7z (ORCPT ); Mon, 27 Apr 2009 23:59:55 -0400 Received: from yx-out-2324.google.com ([74.125.44.29]:16926 "EHLO yx-out-2324.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752676AbZD1D7y convert rfc822-to-8bit (ORCPT ); Mon, 27 Apr 2009 23:59:54 -0400 Received: by yx-out-2324.google.com with SMTP id 3so203359yxj.1 for ; Mon, 27 Apr 2009 20:59:54 -0700 (PDT) MIME-Version: 1.0 Received: by 10.151.15.13 with SMTP id s13mr11448126ybi.135.1240891194326; Mon, 27 Apr 2009 20:59:54 -0700 (PDT) In-Reply-To: <20090427152051.5067e888.akpm@linux-foundation.org> References: <20090303160906.9b30b376.akpm@linux-foundation.org> <20090303192932.31705cf7@lappy.seanm.ca> <20090303.163713.131742043.davem@davemloft.net> <20090427152051.5067e888.akpm@linux-foundation.org> From: Grant Likely Date: Mon, 27 Apr 2009 21:59:39 -0600 Message-ID: Subject: Re: "leds: Add openfirmware platform device support" breaks sparc To: Andrew Morton Cc: David Miller , sparclinux@vger.kernel.org, linuxppc-dev@ozlabs.org, rpurdie@linux.intel.com, tpiepho@freescale.com, smaclennan@pikatech.com, Michal Simek , John Williams Sender: sparclinux-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: sparclinux@vger.kernel.org On Mon, Apr 27, 2009 at 4:20 PM, Andrew Morton wrote: > On Tue, 03 Mar 2009 16:37:13 -0800 (PST) > David Miller wrote: > >> From: Sean MacLennan >> Date: Tue, 3 Mar 2009 19:29:32 -0500 >> >> > It has been..... uhhhh carry the two... longer than I want to admit >> > since I worked on a sparc. Would GPIO based LEDS make sense on a sparc >> > platform? Is sparc used much in the embedded world? >> > >> > If yes, the of_register_platform_driver is just a nice wrapper. It >> > would be trivial to either change it to work on sparc, or add the >> > wrapper to the sparc includes. >> >> We generally create the platform devices by hand for LED >> devices on sparc64. >> >> I'd CONFIG_POWERPC depend this thing for now. > > Nobody has done this, so current mainline's sparc64 allmodconfig remains > busted. > > > This? > > --- a/drivers/leds/Kconfig~a > +++ a/drivers/leds/Kconfig > @@ -139,6 +139,7 @@ config LEDS_GPIO_PLATFORM >  config LEDS_GPIO_OF >        bool "OpenFirmware platform device bindings for GPIO LEDs" >        depends on LEDS_GPIO && OF_DEVICE > +       depends on POWERPC >        default y >        help >          Let the leds-gpio driver drive LEDs which have been defined as PowerPC actually uses CONFIG_PPC, so this doesn't work. However, this might be better: I've compile tested it on powerpc, but I don't have microblaze or sparc xcompilers right now. Also, probably word-wrapped since I'm pasting it into my mailer, but I wanted to keep this within the thread. I'll repost "for real" first thing tomorrow morning. g. commit 302d02a46c67938cf4ef310fec90734cb38acabe Author: Grant Likely Date: Mon Apr 27 21:54:35 2009 -0600 of: make of_(un)register_platform_driver common code. Some drivers using of_register_platform_driver() wrapper break on sparc because the wrapper isn't in the header file. This patch moves it from Microblaze and PowerPC implementations and makes it common code. Signed-off-by: Grant Likely extern struct of_device *of_find_device_by_node(struct device_node *np); Acked-by: David S. Miller diff --git a/arch/microblaze/include/asm/of_platform.h b/arch/microblaze/include/asm/of_platform.h index 187c0ee..3749127 100644 --- a/arch/microblaze/include/asm/of_platform.h +++ b/arch/microblaze/include/asm/of_platform.h @@ -36,16 +36,6 @@ static const struct of_device_id of_default_bus_ids[] = { {}, }; -/* Platform drivers register/unregister */ -static inline int of_register_platform_driver(struct of_platform_driver *drv) -{ - return of_register_driver(drv, &of_platform_bus_type); -} -static inline void of_unregister_platform_driver(struct of_platform_driver *drv) -{ - of_unregister_driver(drv); -} - /* Platform devices and busses creation */ extern struct of_device *of_platform_device_create(struct device_node *np, const char *bus_id, diff --git a/arch/powerpc/include/asm/of_platform.h b/arch/powerpc/include/asm/of_platform.h index 53b4650..d4aaa34 100644 --- a/arch/powerpc/include/asm/of_platform.h +++ b/arch/powerpc/include/asm/of_platform.h @@ -11,16 +11,6 @@ * */ -/* Platform drivers register/unregister */ -static inline int of_register_platform_driver(struct of_platform_driver *drv) -{ - return of_register_driver(drv, &of_platform_bus_type); -} -static inline void of_unregister_platform_driver(struct of_platform_driver *drv) -{ - of_unregister_driver(drv); -} - /* Platform devices and busses creation */ extern struct of_device *of_platform_device_create(struct device_node *np, const char *bus_id, diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h index 3d327b6..9084066 100644 --- a/include/linux/of_platform.h +++ b/include/linux/of_platform.h @@ -51,6 +51,16 @@ extern int of_register_driver(struct of_platform_driver *drv, struct bus_type *bus); extern void of_unregister_driver(struct of_platform_driver *drv); +/* Platform drivers register/unregister */ +static inline int of_register_platform_driver(struct of_platform_driver *drv) +{ + return of_register_driver(drv, &of_platform_bus_type); +} +static inline void of_unregister_platform_driver(struct of_platform_driver *drv) +{ + of_unregister_driver(drv); +} + #include