From patchwork Fri Mar 14 11:09:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Shiyan X-Patchwork-Id: 3832281 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E521CBF540 for ; Fri, 14 Mar 2014 11:09:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D3536202A7 for ; Fri, 14 Mar 2014 11:09:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 607F62026D for ; Fri, 14 Mar 2014 11:09:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753514AbaCNLJa (ORCPT ); Fri, 14 Mar 2014 07:09:30 -0400 Received: from smtp35.i.mail.ru ([94.100.177.95]:55771 "EHLO smtp35.i.mail.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751618AbaCNLJ3 (ORCPT ); Fri, 14 Mar 2014 07:09:29 -0400 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=TqDjNkI6MZw/MZPVWATg7VUa63wj7q4sfdwMA5stcZQ=; b=GcEbVKq2SL55tLz7b0R7nYrSZhU1ShaOQDWIVa95Yt5LtTTmXjoJ2HX5pk9eFG8b/N8kDvVQ4I7OpnGwFbG260T9oq6cW20jHI1+7ZQRxdAQ+r39seUEX1XZ2vuugnyZiqTfEV++EXewsXEt2LTafmaqVuKQYB0XGilSP61ujkU=; Received: from [217.119.30.118] (port=46516 helo=shc.milas.spb.ru) by smtp35.i.mail.ru with esmtpa (envelope-from ) id 1WOPzT-0002SC-6G; Fri, 14 Mar 2014 15:09:27 +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 v2] lcd: Provide dummy functions if CONFIG_LCD_CLASS_DEVICE is not set Date: Fri, 14 Mar 2014 15:09:13 +0400 Message-Id: <1394795353-1931-1-git-send-email-shc_work@mail.ru> X-Mailer: git-send-email 1.8.3.2 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-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=-0.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_WEB, RDNS_NONE, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no 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. This allows us to use the LCD class as an optional. 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..39c41c7 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 NULL; +} + +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 NULL; +} + +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)