From patchwork Thu Mar 13 07:31:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Shiyan X-Patchwork-Id: 3822251 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 020369F369 for ; Thu, 13 Mar 2014 07:35:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E87482027D for ; Thu, 13 Mar 2014 07:35:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 811D720270 for ; Thu, 13 Mar 2014 07:35:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751534AbaCMHfh (ORCPT ); Thu, 13 Mar 2014 03:35:37 -0400 Received: from fallback7.mail.ru ([94.100.176.135]:55753 "EHLO fallback7.mail.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751499AbaCMHfh (ORCPT ); Thu, 13 Mar 2014 03:35:37 -0400 Received: from smtp34.i.mail.ru (smtp34.i.mail.ru [94.100.177.94]) by fallback7.mail.ru (mPOP.Fallback_MX) with ESMTP id 6A396FBB802D for ; Thu, 13 Mar 2014 11:34:00 +0400 (MSK) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.ru; s=mail2; h=Message-Id:Date:Subject:Cc:To:From; bh=Ob5MGTwsrwPG0FoQ+ZNiF4Rt2Q6GVysrSqpSuOyMGXU=; b=m+U8uWSLh5flY3F3sshBJHVqWjPG4vIP1/oXo9b5zmglp5Atpld1X4KRQqDhcTDq4jkNX5V2nrFjgwAPxipaKpdPRcDm31V7sSUUJ8QO+5cWyhsKolZK1vG82abWVBCuB4TxfVqexaMXStpEEL+OtmjCRiuDZtSQC/7Ofwv/p3g=; Received: from [217.119.30.118] (port=45986 helo=shc.milas.spb.ru) by smtp34.i.mail.ru with esmtpa (envelope-from ) id 1WO06w-00079a-0k; Thu, 13 Mar 2014 11:31:29 +0400 From: Alexander Shiyan To: linux-fbdev@vger.kernel.org Cc: Jingoo Han , Bryan Wu , Lee Jones , Jean-Christophe Plagniol-Villard , Tomi Valkeinen , Alexander Shiyan Subject: [PATCH] lcd: Provide dummy functions if CONFIG_LCD_CLASS_DEVICE is not set Date: Thu, 13 Mar 2014 11:31:19 +0400 Message-Id: <1394695879-22845-1-git-send-email-shc_work@mail.ru> X-Mailer: git-send-email 1.8.3.2 X-Mras: Ok Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,RCVD_IN_DNSWL_HI,RCVD_IN_SORBS_WEB,T_DKIM_INVALID, T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Provide dummy functions for LCD register()/unregister() if CONFIG_LCD_CLASS_DEVICE is not set. Signed-off-by: Alexander Shiyan --- include/linux/lcd.h | 37 ++++++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/include/linux/lcd.h b/include/linux/lcd.h index 504f624..f1c94fd 100644 --- a/include/linux/lcd.h +++ b/include/linux/lcd.h @@ -110,14 +110,37 @@ static inline void lcd_set_power(struct lcd_device *ld, int power) mutex_unlock(&ld->update_lock); } -extern struct lcd_device *lcd_device_register(const char *name, - struct device *parent, void *devdata, struct lcd_ops *ops); -extern struct lcd_device *devm_lcd_device_register(struct device *dev, - const char *name, struct device *parent, +#if defined(CONFIG_LCD_CLASS_DEVICE) || defined(CONFIG_LCD_CLASS_DEVICE_MODULE) +struct lcd_device *lcd_device_register(const char *name, struct device *parent, void *devdata, struct lcd_ops *ops); -extern void lcd_device_unregister(struct lcd_device *ld); -extern void devm_lcd_device_unregister(struct device *dev, - struct lcd_device *ld); +struct lcd_device *devm_lcd_device_register(struct device *dev, + const char *name, struct device *parent, void *devdata, + struct lcd_ops *ops); +void lcd_device_unregister(struct lcd_device *ld); +void devm_lcd_device_unregister(struct device *dev, struct lcd_device *ld); +#else +static inline struct lcd_device *lcd_device_register(const char *name, + struct device *parent, void *devdata, struct lcd_ops *ops) +{ + return ERR_PTR(-ENOSYS); +} + +static inline struct lcd_device *devm_lcd_device_register(struct device *dev, + const char *name, struct device *parent, void *devdata, + struct lcd_ops *ops) +{ + return ERR_PTR(-ENOSYS); +} + +static inline void lcd_device_unregister(struct lcd_device *ld) +{ +} + +static inline void devm_lcd_device_unregister(struct device *dev, + struct lcd_device *ld) +{ +} +#endif #define to_lcd_device(obj) container_of(obj, struct lcd_device, dev)