Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933470Ab0BDRXV (ORCPT ); Thu, 4 Feb 2010 12:23:21 -0500 Received: from kroah.org ([198.145.64.141]:34984 "EHLO coco.kroah.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933384Ab0BDRWd (ORCPT ); Thu, 4 Feb 2010 12:22:33 -0500 X-Mailbox-Line: From linux@linux.site Thu Feb 4 09:15:28 2010 Message-Id: <20100204171528.299088377@linux.site> User-Agent: quilt/0.47-14.9 Date: Thu, 04 Feb 2010 09:12:42 -0800 From: Greg KH To: linux-kernel@vger.kernel.org, stable@kernel.org Cc: stable-review@kernel.org, torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, Thadeu Lima de Souza Cascardo , Kay Sievers , Peter Osterlund , Al Viro , Jens Axboe , Greg Kroah-Hartman Subject: [71/74] pktcdvd: removing device does not remove its sysfs dir In-Reply-To: <20100204171850.GA16539@kroah.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1656 Lines: 46 2.6.32-stable review patch. If anyone has any objections, please let us know. ------------------ From: Thadeu Lima de Souza Cascardo commit ca0bf64d99f6e3f6e2fe2585e52a0ac57354beac upstream. This is the counterpart to cba767175becadc5c4016cceb7bfdd2c7fe722f4 ("pktcdvd: remove broken dev_t export of class devices"). Device is not registered using dev_t, so it should not be destroyed using device_destroy which looks up the device by dev_t. This will fail and adding the device again will fail with the "duplicate name" error. This is fixed using device_unregister instead of device_destroy. Signed-off-by: Thadeu Lima de Souza Cascardo Cc: Kay Sievers Cc: Peter Osterlund Cc: Al Viro Cc: Jens Axboe Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- drivers/block/pktcdvd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c @@ -322,7 +322,7 @@ static void pkt_sysfs_dev_remove(struct pkt_kobj_remove(pd->kobj_stat); pkt_kobj_remove(pd->kobj_wqueue); if (class_pktcdvd) - device_destroy(class_pktcdvd, pd->pkt_dev); + device_unregister(pd->dev); } -- 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/