* [PATCH 1/4] Staging: xgifb: Remove #ifdef MODULE
@ 2012-06-06 14:22 Miguel Gómez
2012-06-06 14:22 ` [PATCH 2/4] Staging: xgifb: reorder the code a bit to be more module friendly Miguel Gómez
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Miguel Gómez @ 2012-06-06 14:22 UTC (permalink / raw)
To: arnaud.patard, gregkh, aaro.koskinen, dan.carpenter
Cc: devel, linux-kernel, Miguel Gómez
Check for MODULE is not needed. In a static compilation the parameters
definition is valid and module_exit() does nothing.
Signed-off-by: Miguel Gómez <magomez@igalia.com>
---
drivers/staging/xgifb/XGI_main_26.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/staging/xgifb/XGI_main_26.c b/drivers/staging/xgifb/XGI_main_26.c
index 85dbf32..61dc7cb 100644
--- a/drivers/staging/xgifb/XGI_main_26.c
+++ b/drivers/staging/xgifb/XGI_main_26.c
@@ -2325,8 +2325,6 @@ module_init(xgifb_init);
/* MODULE */
/*****************************************************/
-#ifdef MODULE
-
MODULE_DESCRIPTION("Z7 Z9 Z9S Z11 framebuffer device driver");
MODULE_LICENSE("GPL");
MODULE_AUTHOR("XGITECH , Others");
@@ -2359,5 +2357,3 @@ static void __exit xgifb_remove_module(void)
}
module_exit(xgifb_remove_module);
-
-#endif /* /MODULE */
--
1.7.9.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/4] Staging: xgifb: reorder the code a bit to be more module friendly
2012-06-06 14:22 [PATCH 1/4] Staging: xgifb: Remove #ifdef MODULE Miguel Gómez
@ 2012-06-06 14:22 ` Miguel Gómez
2012-06-12 0:01 ` Greg KH
2012-06-06 14:22 ` [PATCH 3/4] Staging: xgifb: disable pci device if there's an error after enabling it Miguel Gómez
2012-06-06 14:22 ` [PATCH 4/4] Staging: xgifb: disable pci device on pci remove function Miguel Gómez
2 siblings, 1 reply; 6+ messages in thread
From: Miguel Gómez @ 2012-06-06 14:22 UTC (permalink / raw)
To: arnaud.patard, gregkh, aaro.koskinen, dan.carpenter
Cc: devel, linux-kernel, Miguel Gómez
Signed-off-by: Miguel Gómez <magomez@igalia.com>
---
drivers/staging/xgifb/XGI_main_26.c | 51 +++++++++++++++++------------------
1 file changed, 25 insertions(+), 26 deletions(-)
diff --git a/drivers/staging/xgifb/XGI_main_26.c b/drivers/staging/xgifb/XGI_main_26.c
index 61dc7cb..96abb23 100644
--- a/drivers/staging/xgifb/XGI_main_26.c
+++ b/drivers/staging/xgifb/XGI_main_26.c
@@ -2306,49 +2306,44 @@ static struct pci_driver xgifb_driver = {
.remove = __devexit_p(xgifb_remove)
};
-static int __init xgifb_init(void)
-{
- char *option = NULL;
-
- if (forcecrt2type != NULL)
- XGIfb_search_crt2type(forcecrt2type);
- if (fb_get_options("xgifb", &option))
- return -ENODEV;
- XGIfb_setup(option);
-
- return pci_register_driver(&xgifb_driver);
-}
-module_init(xgifb_init);
/*****************************************************/
/* MODULE */
/*****************************************************/
-MODULE_DESCRIPTION("Z7 Z9 Z9S Z11 framebuffer device driver");
-MODULE_LICENSE("GPL");
-MODULE_AUTHOR("XGITECH , Others");
-
module_param(mode, charp, 0);
-module_param(vesa, int, 0);
-module_param(filter, int, 0);
-module_param(forcecrt2type, charp, 0);
+MODULE_PARM_DESC(mode,
+ "\nSelects the desired default display mode in the format XxYxDepth,\n"
+ "eg. 1024x768x16.\n");
+module_param(forcecrt2type, charp, 0);
MODULE_PARM_DESC(forcecrt2type,
"\nForce the second display output type. Possible values are NONE,\n"
"LCD, TV, VGA, SVIDEO or COMPOSITE.\n");
-MODULE_PARM_DESC(mode,
- "\nSelects the desired default display mode in the format XxYxDepth,\n"
- "eg. 1024x768x16.\n");
-
+module_param(vesa, int, 0);
MODULE_PARM_DESC(vesa,
"\nSelects the desired default display mode by VESA mode number, eg.\n"
"0x117.\n");
+module_param(filter, int, 0);
MODULE_PARM_DESC(filter,
- "\nSelects TV flicker filter type (only for systems with a SiS301 video bridge).\n"
- "(Possible values 0-7, default: [no filter])\n");
+ "\nSelects TV flicker filter type (only for systems with a SiS301 video bridge).\n"
+ "(Possible values 0-7, default: [no filter])\n");
+
+static int __init xgifb_init(void)
+{
+ char *option = NULL;
+
+ if (forcecrt2type != NULL)
+ XGIfb_search_crt2type(forcecrt2type);
+ if (fb_get_options("xgifb", &option))
+ return -ENODEV;
+ XGIfb_setup(option);
+
+ return pci_register_driver(&xgifb_driver);
+}
static void __exit xgifb_remove_module(void)
{
@@ -2356,4 +2351,8 @@ static void __exit xgifb_remove_module(void)
pr_debug("Module unloaded\n");
}
+MODULE_DESCRIPTION("Z7 Z9 Z9S Z11 framebuffer device driver");
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("XGITECH , Others");
+module_init(xgifb_init);
module_exit(xgifb_remove_module);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/4] Staging: xgifb: disable pci device if there's an error after enabling it.
2012-06-06 14:22 [PATCH 1/4] Staging: xgifb: Remove #ifdef MODULE Miguel Gómez
2012-06-06 14:22 ` [PATCH 2/4] Staging: xgifb: reorder the code a bit to be more module friendly Miguel Gómez
@ 2012-06-06 14:22 ` Miguel Gómez
2012-06-06 14:22 ` [PATCH 4/4] Staging: xgifb: disable pci device on pci remove function Miguel Gómez
2 siblings, 0 replies; 6+ messages in thread
From: Miguel Gómez @ 2012-06-06 14:22 UTC (permalink / raw)
To: arnaud.patard, gregkh, aaro.koskinen, dan.carpenter
Cc: devel, linux-kernel, Miguel Gómez
Signed-off-by: Miguel Gómez <magomez@igalia.com>
---
drivers/staging/xgifb/XGI_main_26.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/xgifb/XGI_main_26.c b/drivers/staging/xgifb/XGI_main_26.c
index 96abb23..438781f 100644
--- a/drivers/staging/xgifb/XGI_main_26.c
+++ b/drivers/staging/xgifb/XGI_main_26.c
@@ -1904,7 +1904,7 @@ static int __devinit xgifb_probe(struct pci_dev *pdev,
if (reg1 != 0xa1) { /*I/O error */
pr_err("I/O error!!!");
ret = -EIO;
- goto error;
+ goto error_disable;
}
switch (xgifb_info->chip_id) {
@@ -1927,7 +1927,7 @@ static int __devinit xgifb_probe(struct pci_dev *pdev,
break;
default:
ret = -ENODEV;
- goto error;
+ goto error_disable;
}
pr_info("chipid = %x\n", xgifb_info->chip);
@@ -1936,7 +1936,7 @@ static int __devinit xgifb_probe(struct pci_dev *pdev,
if (XGIfb_get_dram_size(xgifb_info)) {
pr_err("Fatal error: Unable to determine RAM size.\n");
ret = -ENODEV;
- goto error;
+ goto error_disable;
}
/* Enable PCI_LINEAR_ADDRESSING and MMIO_ENABLE */
@@ -1956,7 +1956,7 @@ static int __devinit xgifb_probe(struct pci_dev *pdev,
pr_err("Fatal error: Unable to reserve frame buffer memory\n");
pr_err("Is there another framebuffer driver active?\n");
ret = -ENODEV;
- goto error;
+ goto error_disable;
}
if (!request_mem_region(xgifb_info->mmio_base,
@@ -2271,6 +2271,8 @@ error_1:
release_mem_region(xgifb_info->mmio_base, xgifb_info->mmio_size);
error_0:
release_mem_region(xgifb_info->video_base, xgifb_info->video_size);
+error_disable:
+ pci_disable_device(pdev);
error:
framebuffer_release(fb_info);
return ret;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 4/4] Staging: xgifb: disable pci device on pci remove function.
2012-06-06 14:22 [PATCH 1/4] Staging: xgifb: Remove #ifdef MODULE Miguel Gómez
2012-06-06 14:22 ` [PATCH 2/4] Staging: xgifb: reorder the code a bit to be more module friendly Miguel Gómez
2012-06-06 14:22 ` [PATCH 3/4] Staging: xgifb: disable pci device if there's an error after enabling it Miguel Gómez
@ 2012-06-06 14:22 ` Miguel Gómez
2 siblings, 0 replies; 6+ messages in thread
From: Miguel Gómez @ 2012-06-06 14:22 UTC (permalink / raw)
To: arnaud.patard, gregkh, aaro.koskinen, dan.carpenter
Cc: devel, linux-kernel, Miguel Gómez
Signed-off-by: Miguel Gómez <magomez@igalia.com>
---
drivers/staging/xgifb/XGI_main_26.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/staging/xgifb/XGI_main_26.c b/drivers/staging/xgifb/XGI_main_26.c
index 438781f..033463d 100644
--- a/drivers/staging/xgifb/XGI_main_26.c
+++ b/drivers/staging/xgifb/XGI_main_26.c
@@ -2297,6 +2297,7 @@ static void __devexit xgifb_remove(struct pci_dev *pdev)
iounmap(xgifb_info->video_vbase);
release_mem_region(xgifb_info->mmio_base, xgifb_info->mmio_size);
release_mem_region(xgifb_info->video_base, xgifb_info->video_size);
+ pci_disable_device(pdev);
framebuffer_release(fb_info);
pci_set_drvdata(pdev, NULL);
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 2/4] Staging: xgifb: reorder the code a bit to be more module friendly
2012-06-06 14:22 ` [PATCH 2/4] Staging: xgifb: reorder the code a bit to be more module friendly Miguel Gómez
@ 2012-06-12 0:01 ` Greg KH
2012-06-18 10:52 ` Miguel Gómez
0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2012-06-12 0:01 UTC (permalink / raw)
To: Miguel Gómez
Cc: arnaud.patard, aaro.koskinen, dan.carpenter, devel, linux-kernel
On Wed, Jun 06, 2012 at 04:22:05PM +0200, Miguel Gómez wrote:
> Signed-off-by: Miguel Gómez <magomez@igalia.com>
> ---
> drivers/staging/xgifb/XGI_main_26.c | 51 +++++++++++++++++------------------
> 1 file changed, 25 insertions(+), 26 deletions(-)
>
> diff --git a/drivers/staging/xgifb/XGI_main_26.c b/drivers/staging/xgifb/XGI_main_26.c
> index 61dc7cb..96abb23 100644
> --- a/drivers/staging/xgifb/XGI_main_26.c
> +++ b/drivers/staging/xgifb/XGI_main_26.c
> @@ -2306,49 +2306,44 @@ static struct pci_driver xgifb_driver = {
> .remove = __devexit_p(xgifb_remove)
> };
>
> -static int __init xgifb_init(void)
> -{
> - char *option = NULL;
> -
> - if (forcecrt2type != NULL)
> - XGIfb_search_crt2type(forcecrt2type);
> - if (fb_get_options("xgifb", &option))
> - return -ENODEV;
> - XGIfb_setup(option);
> -
> - return pci_register_driver(&xgifb_driver);
> -}
>
> -module_init(xgifb_init);
>
> /*****************************************************/
> /* MODULE */
> /*****************************************************/
>
> -MODULE_DESCRIPTION("Z7 Z9 Z9S Z11 framebuffer device driver");
> -MODULE_LICENSE("GPL");
> -MODULE_AUTHOR("XGITECH , Others");
> -
> module_param(mode, charp, 0);
> -module_param(vesa, int, 0);
> -module_param(filter, int, 0);
> -module_param(forcecrt2type, charp, 0);
> +MODULE_PARM_DESC(mode,
> + "\nSelects the desired default display mode in the format XxYxDepth,\n"
> + "eg. 1024x768x16.\n");
>
> +module_param(forcecrt2type, charp, 0);
> MODULE_PARM_DESC(forcecrt2type,
> "\nForce the second display output type. Possible values are NONE,\n"
> "LCD, TV, VGA, SVIDEO or COMPOSITE.\n");
What's with these "\n" in the string? Shouldn't those be removed?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/4] Staging: xgifb: reorder the code a bit to be more module friendly
2012-06-12 0:01 ` Greg KH
@ 2012-06-18 10:52 ` Miguel Gómez
0 siblings, 0 replies; 6+ messages in thread
From: Miguel Gómez @ 2012-06-18 10:52 UTC (permalink / raw)
To: Greg KH; +Cc: arnaud.patard, aaro.koskinen, dan.carpenter, devel, linux-kernel
>> /*****************************************************/
>> /* MODULE */
>> /*****************************************************/
>>
>> -MODULE_DESCRIPTION("Z7 Z9 Z9S Z11 framebuffer device driver");
>> -MODULE_LICENSE("GPL");
>> -MODULE_AUTHOR("XGITECH , Others");
>> -
>> module_param(mode, charp, 0);
>> -module_param(vesa, int, 0);
>> -module_param(filter, int, 0);
>> -module_param(forcecrt2type, charp, 0);
>> +MODULE_PARM_DESC(mode,
>> + "\nSelects the desired default display mode in the format XxYxDepth,\n"
>> + "eg. 1024x768x16.\n");
>>
>> +module_param(forcecrt2type, charp, 0);
>> MODULE_PARM_DESC(forcecrt2type,
>> "\nForce the second display output type. Possible values are NONE,\n"
>> "LCD, TV, VGA, SVIDEO or COMPOSITE.\n");
>
> What's with these "\n" in the string? Shouldn't those be removed?
Sure, I'll clean them in the next round of patches :)
(sorry for the delay)
Cheers!
--
Miguel Gómez
Igalia - http://www.igalia.com
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-06-18 10:52 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-06 14:22 [PATCH 1/4] Staging: xgifb: Remove #ifdef MODULE Miguel Gómez
2012-06-06 14:22 ` [PATCH 2/4] Staging: xgifb: reorder the code a bit to be more module friendly Miguel Gómez
2012-06-12 0:01 ` Greg KH
2012-06-18 10:52 ` Miguel Gómez
2012-06-06 14:22 ` [PATCH 3/4] Staging: xgifb: disable pci device if there's an error after enabling it Miguel Gómez
2012-06-06 14:22 ` [PATCH 4/4] Staging: xgifb: disable pci device on pci remove function Miguel Gómez
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.