From patchwork Fri Nov 16 21:16:45 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 1757241 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id C43B33FCDE for ; Fri, 16 Nov 2012 21:16:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753345Ab2KPVQr (ORCPT ); Fri, 16 Nov 2012 16:16:47 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:46027 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751459Ab2KPVQq (ORCPT ); Fri, 16 Nov 2012 16:16:46 -0500 Received: from akpm.mtv.corp.google.com (216-239-45-4.google.com [216.239.45.4]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id C2DC49CA; Fri, 16 Nov 2012 21:16:45 +0000 (UTC) Date: Fri, 16 Nov 2012 13:16:45 -0800 From: Andrew Morton To: Thierry Reding Cc: Richard Purdie , Florian Tobias Schandinat , linux-fbdev@vger.kernel.org, devicetree-discuss@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] backlight: Add of_find_backlight_by_node() function Message-Id: <20121116131645.c979837c.akpm@linux-foundation.org> In-Reply-To: <1352469878-4532-1-git-send-email-thierry.reding@avionic-design.de> References: <1352469878-4532-1-git-send-email-thierry.reding@avionic-design.de> X-Mailer: Sylpheed 3.0.2 (GTK+ 2.20.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org On Fri, 9 Nov 2012 15:04:38 +0100 Thierry Reding wrote: > This function finds the struct backlight_device for a given device tree > node. A dummy function is provided so that it safely compiles out if OF > support is disabled. > > Signed-off-by: Thierry Reding > --- > drivers/video/backlight/backlight.c | 17 +++++++++++++++++ > include/linux/backlight.h | 10 ++++++++++ > 2 files changed, 27 insertions(+) > > diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c > index 297db2f..0d1ed4f 100644 > --- a/drivers/video/backlight/backlight.c > +++ b/drivers/video/backlight/backlight.c > @@ -370,6 +370,23 @@ void backlight_device_unregister(struct backlight_device *bd) > } > EXPORT_SYMBOL(backlight_device_unregister); > > +#if IS_ENABLED(CONFIG_OF) Using IS_ENABLED() was odd. We'll never support CONFIG_OF=m, so can't we use plain old "#ifdef CONFIG_OF" here? --- a/drivers/video/backlight/backlight.c~backlight-add-of_find_backlight_by_node-function-fix +++ a/drivers/video/backlight/backlight.c @@ -370,7 +370,7 @@ void backlight_device_unregister(struct } EXPORT_SYMBOL(backlight_device_unregister); -#if IS_ENABLED(CONFIG_OF) +#ifdef CONFIG_OF static int of_parent_match(struct device *dev, void *data) { return dev->parent && dev->parent->of_node == data; --- a/include/linux/backlight.h~backlight-add-of_find_backlight_by_node-function-fix +++ a/include/linux/backlight.h @@ -134,7 +134,7 @@ struct generic_bl_info { void (*kick_battery)(void); }; -#if IS_ENABLED(CONFIG_OF) +#ifdef CONFIG_OF struct backlight_device *of_find_backlight_by_node(struct device_node *node); #else static inline struct backlight_device *