Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933821Ab2KZRNC (ORCPT ); Mon, 26 Nov 2012 12:13:02 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:48018 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932206Ab2KZRM5 (ORCPT ); Mon, 26 Nov 2012 12:12:57 -0500 From: Herton Ronaldo Krzesinski To: linux-kernel@vger.kernel.org, stable@vger.kernel.org, kernel-team@lists.ubuntu.com Cc: Peter Huewe , Chanwoo Choi , Herton Ronaldo Krzesinski Subject: [PATCH 209/270] extcon: unregister compat link on cleanup Date: Mon, 26 Nov 2012 14:58:19 -0200 Message-Id: <1353949160-26803-210-git-send-email-herton.krzesinski@canonical.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1353949160-26803-1-git-send-email-herton.krzesinski@canonical.com> References: <1353949160-26803-1-git-send-email-herton.krzesinski@canonical.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1380 Lines: 42 3.5.7u1 -stable review patch. If anyone has any objections, please let me know. ------------------ From: Peter Huewe commit 824a1bc045cef278aec15bef35d8d0b59ce77856 upstream. Since extcon registers this compat link at device registration (extcon_dev_register), we should probably remove them at deregistration/cleanup. Signed-off-by: Peter Huewe Signed-off-by: Chanwoo Choi [ herton: file name is extcon_class.c on 3.5 ] Signed-off-by: Herton Ronaldo Krzesinski --- drivers/extcon/extcon_class.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/extcon/extcon_class.c b/drivers/extcon/extcon_class.c index 01bac36..0a710b0 100644 --- a/drivers/extcon/extcon_class.c +++ b/drivers/extcon/extcon_class.c @@ -575,6 +575,10 @@ static void extcon_cleanup(struct extcon_dev *edev, bool skip) kfree(edev->cables); } +#if defined(CONFIG_ANDROID) + if (switch_class) + class_compat_remove_link(switch_class, edev->dev, NULL); +#endif device_unregister(edev->dev); put_device(edev->dev); } -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/