From patchwork Fri May 9 01:24:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 4139871 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 44E78BFF02 for ; Fri, 9 May 2014 01:25:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5E12E202EA for ; Fri, 9 May 2014 01:25:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5B699202DD for ; Fri, 9 May 2014 01:25:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755340AbaEIBZB (ORCPT ); Thu, 8 May 2014 21:25:01 -0400 Received: from mho-02-ewr.mailhop.org ([204.13.248.72]:14852 "EHLO mho-02-ewr.mailhop.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754251AbaEIBZB (ORCPT ); Thu, 8 May 2014 21:25:01 -0400 Received: from 99-127-230-128.lightspeed.sntcca.sbcglobal.net ([99.127.230.128] helo=atomide.com) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.72) (envelope-from ) id 1WiZYZ-000HBY-RX; Fri, 09 May 2014 01:25:00 +0000 X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 99.127.230.128 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1+pju3/bMUGFHIS3CGmC4A1 Date: Thu, 8 May 2014 18:24:55 -0700 From: Tony Lindgren To: Lee Jones Cc: linux-kernel@vger.kernel.org, linux-fbdev@vger.kernel.org, linux-omap@vger.kernel.org, Bryan Wu , Jingoo Han , Jean-Christophe Plagniol-Villard , Tomi Valkeinen Subject: [PATCH] backlight: gpio-backlight: Fix warning when the GPIO is on a I2C chip Message-ID: <20140509012454.GL2198@atomide.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 If the GPIO for the backlight is on an I2C chip, we currently get nasty warnings like this during the boot: WARNING: CPU: 0 PID: 6 at drivers/gpio/gpiolib.c:2364 gpiod_set_raw_value+0x40/0x4c() Modules linked in: CPU: 0 PID: 6 Comm: kworker/u2:0 Not tainted 3.15.0-rc4-12393-gcde9f4e #400 Workqueue: deferwq deferred_probe_work_func [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [] (show_stack) from [] (dump_stack+0x80/0x9c) [] (dump_stack) from [] (warn_slowpath_common+0x68/0x8c) [] (warn_slowpath_common) from [] (warn_slowpath_null+0x1c/0x24) [] (warn_slowpath_null) from [] (gpiod_set_raw_value+0x40/0x4c) [] (gpiod_set_raw_value) from [] (gpio_backlight_update_status+0x4c/0x74) [] (gpio_backlight_update_status) from [] (gpio_backlight_probe+0x168/0x254) [] (gpio_backlight_probe) from [] (platform_drv_probe+0x18/0x48) [] (platform_drv_probe) from [] (driver_probe_device+0x10c/0x238) [] (driver_probe_device) from [] (bus_for_each_drv+0x44/0x8c) [] (bus_for_each_drv) from [] (device_attach+0x74/0x8c) [] (device_attach) from [] (bus_probe_device+0x88/0xb0) [] (bus_probe_device) from [] (deferred_probe_work_func+0x64/0x94) [] (deferred_probe_work_func) from [] (process_one_work+0x1b4/0x4bc) [] (process_one_work) from [] (worker_thread+0x11c/0x398) [] (worker_thread) from [] (kthread+0xc8/0xe4) [] (kthread) from [] (ret_from_fork+0x14/0x2c) Fix this by using gpio_set_value_cansleep() as suggested in drivers/gpio/gpiolib.c:2364. This is what the other backlight drivers are also doing. Signed-off-by: Tony Lindgren Acked-by: Jingoo Han --- To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/drivers/video/backlight/gpio_backlight.c +++ b/drivers/video/backlight/gpio_backlight.c @@ -38,7 +38,8 @@ static int gpio_backlight_update_status(struct backlight_device *bl) bl->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK)) brightness = 0; - gpio_set_value(gbl->gpio, brightness ? gbl->active : !gbl->active); + gpio_set_value_cansleep(gbl->gpio, + brightness ? gbl->active : !gbl->active); return 0; }