From patchwork Thu Jul 19 00:39:17 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 1213511 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 7B4F53FD4F for ; Thu, 19 Jul 2012 00:39:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752542Ab2GSAj0 (ORCPT ); Wed, 18 Jul 2012 20:39:26 -0400 Received: from perceval.ideasonboard.com ([95.142.166.194]:52316 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752527Ab2GSAjY (ORCPT ); Wed, 18 Jul 2012 20:39:24 -0400 Received: from avalon.ideasonboard.com (unknown [91.178.56.248]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 40CA435A89; Thu, 19 Jul 2012 02:39:21 +0200 (CEST) From: Laurent Pinchart To: linux-fbdev@vger.kernel.org Cc: linux-sh@vger.kernel.org Subject: [PATCH 4/9] fbdev: sh_mobile_lcdc: Destroy mutex at remove time Date: Thu, 19 Jul 2012 02:39:17 +0200 Message-Id: <1342658362-19491-5-git-send-email-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 1.7.8.6 In-Reply-To: <1342658362-19491-1-git-send-email-laurent.pinchart@ideasonboard.com> References: <1342658362-19491-1-git-send-email-laurent.pinchart@ideasonboard.com> Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org Add a missing mutex_destroy() call when the driver is unbound from the device. Signed-off-by: Laurent Pinchart --- drivers/video/sh_mobile_lcdcfb.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c index 9da4b1b6..644c230 100644 --- a/drivers/video/sh_mobile_lcdcfb.c +++ b/drivers/video/sh_mobile_lcdcfb.c @@ -2444,8 +2444,11 @@ static int sh_mobile_lcdc_remove(struct platform_device *pdev) } for (i = 0; i < ARRAY_SIZE(priv->ch); i++) { - if (priv->ch[i].bl) - sh_mobile_lcdc_bl_remove(priv->ch[i].bl); + struct sh_mobile_lcdc_chan *ch = &priv->ch[i]; + + if (ch->bl) + sh_mobile_lcdc_bl_remove(ch->bl); + mutex_destroy(&ch->open_lock); } if (priv->dot_clk) {