From patchwork Wed Jul 20 12:07:36 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doron Cohen X-Patchwork-Id: 991082 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p6KBuElD007678 for ; Wed, 20 Jul 2011 11:56:14 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751184Ab1GTL4M (ORCPT ); Wed, 20 Jul 2011 07:56:12 -0400 Received: from mr.siano-ms.com ([62.0.79.70]:35541 "EHLO Siano-NV.ser.netvision.net.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751075Ab1GTL4L convert rfc822-to-8bit (ORCPT ); Wed, 20 Jul 2011 07:56:11 -0400 Received: from 172.20.255.254 ([172.20.255.254]) by s-mail.siano-ms.ent ([172.20.1.2]) with Microsoft Exchange Server HTTP-DAV ; Wed, 20 Jul 2011 11:59:45 +0000 Received: from doron-ubuntu by mail.siano-ms.com; 20 Jul 2011 15:07:36 +0300 Subject: [PATCH] siano: apply debug flag to module level. From: Doron Cohen Reply-To: doronc@siano-ms.com To: linux-media@vger.kernel.org Organization: Siano Mobile Silicon Date: Wed, 20 Jul 2011 15:07:36 +0300 Message-ID: <1311163656.32566.6.camel@doron-ubuntu> Mime-Version: 1.0 X-Mailer: Evolution 2.32.2 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Wed, 20 Jul 2011 11:56:14 +0000 (UTC) Hi, Siano modules already had sms_dbg flag which is a module parameter which sets the debug mode so module prints messages to dmesg for debugging. The variable was static therefore apply only to the file which defines the module. In modules as smsmdtv.ko that contain a few files, the debug flag applied only for functions in that main file. flag was changed to be non-static and therefore can be accessed by all module files (although it is still not exported out of the module). Thanks, Doron Signed-off-by: Doron Cohen --- drivers/media/dvb/siano/sms-cards.c | 4 ---- drivers/media/dvb/siano/smscoreapi.c | 2 +- drivers/media/dvb/siano/smscoreapi.h | 1 + drivers/media/dvb/siano/smsdvb.c | 2 +- drivers/media/dvb/siano/smsusb.c | 2 +- 5 files changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/media/dvb/siano/sms-cards.c b/drivers/media/dvb/siano/sms-cards.c index af121db..cf442dc 100644 --- a/drivers/media/dvb/siano/sms-cards.c +++ b/drivers/media/dvb/siano/sms-cards.c @@ -20,10 +20,6 @@ #include "sms-cards.h" #include "smsir.h" -static int sms_dbg; -module_param_named(cards_dbg, sms_dbg, int, 0644); -MODULE_PARM_DESC(cards_dbg, "set debug level (info=1, adv=2 (or-able))"); - static struct sms_board sms_boards[] = { [SMS_BOARD_UNKNOWN] = { .name = "Unknown board", diff --git a/drivers/media/dvb/siano/smscoreapi.c b/drivers/media/dvb/siano/smscoreapi.c index 78765ed..239f453 100644 --- a/drivers/media/dvb/siano/smscoreapi.c +++ b/drivers/media/dvb/siano/smscoreapi.c @@ -39,7 +39,7 @@ #include "smsir.h" #include "smsendian.h" -static int sms_dbg; +int sms_dbg; module_param_named(debug, sms_dbg, int, 0644); MODULE_PARM_DESC(debug, "set debug level (info=1, adv=2 (or-able))"); diff --git a/drivers/media/dvb/siano/smscoreapi.h b/drivers/media/dvb/siano/smscoreapi.h index 8ecadec..05dd9f6 100644 --- a/drivers/media/dvb/siano/smscoreapi.h +++ b/drivers/media/dvb/siano/smscoreapi.h @@ -752,6 +752,7 @@ int smscore_led_state(struct smscore_device_t *core, int led); /* ------------------------------------------------------------------------ */ +extern int sms_dbg; #define DBG_INFO 1 #define DBG_ADV 2 diff --git a/drivers/media/dvb/siano/smsdvb.c b/drivers/media/dvb/siano/smsdvb.c index 37c594f..9fbf022 100644 --- a/drivers/media/dvb/siano/smsdvb.c +++ b/drivers/media/dvb/siano/smsdvb.c @@ -60,7 +60,7 @@ struct smsdvb_client_t { static struct list_head g_smsdvb_clients; static struct mutex g_smsdvb_clientslock; -static int sms_dbg; +int sms_dbg; module_param_named(debug, sms_dbg, int, 0644); MODULE_PARM_DESC(debug, "set debug level (info=1, adv=2 (or-able))"); diff --git a/drivers/media/dvb/siano/smsusb.c b/drivers/media/dvb/siano/smsusb.c index 0b8da57..da4628d 100644 --- a/drivers/media/dvb/siano/smsusb.c +++ b/drivers/media/dvb/siano/smsusb.c @@ -29,7 +29,7 @@ along with this program. If not, see . #include "sms-cards.h" #include "smsendian.h" -static int sms_dbg; +int sms_dbg; module_param_named(debug, sms_dbg, int, 0644); MODULE_PARM_DESC(debug, "set debug level (info=1, adv=2 (or-able))");