Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753831AbcL3L0I (ORCPT ); Fri, 30 Dec 2016 06:26:08 -0500 Received: from mail-pg0-f68.google.com ([74.125.83.68]:32966 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753774AbcL3L0G (ORCPT ); Fri, 30 Dec 2016 06:26:06 -0500 From: Cheah Kok Cheong To: abbotti@mev.co.uk, hsweeten@visionengravers.com, gregkh@linuxfoundation.org Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Cheah Kok Cheong Subject: [PATCH 1/5] Staging: comedi: comedi_fops: Avoid orphaned proc entry Date: Fri, 30 Dec 2016 19:25:52 +0800 Message-Id: <6635b2bc18f3661d64ff5039ec47bbdac3cdbebb.1483094820.git.thrust73@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 960 Lines: 34 Move comedi_proc_init to the end to avoid orphaned proc entry if module loading failed. Signed-off-by: Cheah Kok Cheong --- drivers/staging/comedi/comedi_fops.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c index 64b3966..02df354 100644 --- a/drivers/staging/comedi/comedi_fops.c +++ b/drivers/staging/comedi/comedi_fops.c @@ -2898,9 +2898,6 @@ static int __init comedi_init(void) comedi_class->dev_groups = comedi_dev_groups; - /* XXX requires /proc interface */ - comedi_proc_init(); - /* create devices files for legacy/manual use */ for (i = 0; i < comedi_num_legacy_minors; i++) { struct comedi_device *dev; @@ -2917,6 +2914,9 @@ static int __init comedi_init(void) mutex_unlock(&dev->mutex); } + /* XXX requires /proc interface */ + comedi_proc_init(); + return 0; } module_init(comedi_init); -- 2.7.4