From patchwork Thu Jan 6 18:23:58 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 460111 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p06INrak015393 for ; Thu, 6 Jan 2011 18:24:00 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752710Ab1AFSYA (ORCPT ); Thu, 6 Jan 2011 13:24:00 -0500 Received: from moutng.kundenserver.de ([212.227.126.171]:58883 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751686Ab1AFSX7 (ORCPT ); Thu, 6 Jan 2011 13:23:59 -0500 Received: from axis700.grange (pD9EB8D9E.dip0.t-ipconnect.de [217.235.141.158]) by mrelayeu.kundenserver.de (node=mreu2) with ESMTP (Nemesis) id 0LpRtB-1QDqHb1Wjt-00eoxe; Thu, 06 Jan 2011 19:23:58 +0100 Received: by axis700.grange (Postfix, from userid 1000) id 18CE6189B93; Thu, 6 Jan 2011 19:23:58 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by axis700.grange (Postfix) with ESMTP id 15F16189B8D; Thu, 6 Jan 2011 19:23:58 +0100 (CET) Date: Thu, 6 Jan 2011 19:23:58 +0100 (CET) From: Guennadi Liakhovetski X-X-Sender: lyakh@axis700.grange To: linux-sh@vger.kernel.org cc: linux-fbdev@vger.kernel.org Subject: [PATCH 2/3] fbdev: sh_mobile_hdmi: framebuffer notifiers have to be registered In-Reply-To: Message-ID: References: MIME-Version: 1.0 X-Provags-ID: V02:K0:70zeXvxro2uBw+otqDURndSUk78M+jJsIuTTGLULZ4f uKK97IKtJl7qR3nt+VPcBm/joTRKWrxU87GZYZV4eSKRVOXlIR l9auw4FvfIG3FVoryneVcs20mzCdnZnjJcRq6WA8a0xJ1FY06k JQAmzqZQKvi6uSPa7AUJviaTWVXWh4ZGcv46EUHIcqVTmn497e OrdQUMuy5QcaPuNd2z2Rt4B/uXhrKbZgq7lkiWr4ko= Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 06 Jan 2011 18:24:02 +0000 (UTC) diff --git a/drivers/video/sh_mobile_hdmi.c b/drivers/video/sh_mobile_hdmi.c index f18a619..4a1f3f4 100644 --- a/drivers/video/sh_mobile_hdmi.c +++ b/drivers/video/sh_mobile_hdmi.c @@ -217,6 +217,7 @@ struct sh_hdmi { struct delayed_work edid_work; struct fb_var_screeninfo var; struct fb_monspecs monspec; + struct notifier_block notifier; }; static void hdmi_write(struct sh_hdmi *hdmi, u8 data, u8 reg) @@ -1126,13 +1127,6 @@ out: } static int sh_hdmi_notify(struct notifier_block *nb, - unsigned long action, void *data); - -static struct notifier_block sh_hdmi_notifier = { - .notifier_call = sh_hdmi_notify, -}; - -static int sh_hdmi_notify(struct notifier_block *nb, unsigned long action, void *data) { struct fb_event *event = data; @@ -1141,7 +1135,7 @@ static int sh_hdmi_notify(struct notifier_block *nb, struct sh_mobile_lcdc_board_cfg *board_cfg = &ch->cfg.board_cfg; struct sh_hdmi *hdmi = board_cfg->board_data; - if (nb != &sh_hdmi_notifier || !hdmi || hdmi->info != info) + if (!hdmi || nb != &hdmi->notifier || hdmi->info != info) return NOTIFY_DONE; switch(action) { @@ -1160,11 +1154,11 @@ static int sh_hdmi_notify(struct notifier_block *nb, * temporarily, synchronise with the work queue and re-acquire * the info->lock. */ - unlock_fb_info(hdmi->info); + unlock_fb_info(info); mutex_lock(&hdmi->mutex); hdmi->info = NULL; mutex_unlock(&hdmi->mutex); - lock_fb_info(hdmi->info); + lock_fb_info(info); return NOTIFY_OK; } return NOTIFY_DONE; @@ -1253,6 +1247,9 @@ static int __init sh_hdmi_probe(struct platform_device *pdev) goto ecodec; } + hdmi->notifier.notifier_call = sh_hdmi_notify; + fb_register_client(&hdmi->notifier); + return 0; ecodec: @@ -1283,6 +1280,8 @@ static int __exit sh_hdmi_remove(struct platform_device *pdev) snd_soc_unregister_codec(&pdev->dev); + fb_unregister_client(&hdmi->notifier); + board_cfg->display_on = NULL; board_cfg->display_off = NULL; board_cfg->board_data = NULL;