Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753060AbbDCNN3 (ORCPT ); Fri, 3 Apr 2015 09:13:29 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:40797 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752863AbbDCNN2 (ORCPT ); Fri, 3 Apr 2015 09:13:28 -0400 Date: Fri, 3 Apr 2015 15:13:23 +0200 From: Greg KH To: Phong Tran Cc: arve@android.com, riandrews@android.com, dan.carpenter@oracle.com, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH V2 2/3] staging: android: ion_test: unregister the misc device Message-ID: <20150403131323.GA11031@kroah.com> References: <1427909900-22650-4-git-send-email-tranmanphong@gmail.com> <1427985367-20099-1-git-send-email-tranmanphong@gmail.com> <1427985367-20099-3-git-send-email-tranmanphong@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1427985367-20099-3-git-send-email-tranmanphong@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1135 Lines: 34 On Thu, Apr 02, 2015 at 09:36:06PM +0700, Phong Tran wrote: > Add the remove() method for deregister from misc device > when it's unloaded. > > Signed-off-by: Phong Tran > --- > drivers/staging/android/ion/ion_test.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/drivers/staging/android/ion/ion_test.c b/drivers/staging/android/ion/ion_test.c > index 3bc461c..d6a9653 100644 > --- a/drivers/staging/android/ion/ion_test.c > +++ b/drivers/staging/android/ion/ion_test.c > @@ -261,7 +261,19 @@ static int __init ion_test_probe(struct platform_device *pdev) > return 0; > } > > +static int ion_test_remove(struct platform_device *pdev) > +{ > + struct ion_test_device *testdev; > + > + testdev = platform_get_drvdata(pdev); > + if (!testdev) > + return -ENODATA; > + > + return misc_deregister(&testdev->misc); Extra space here :( -- 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/