linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] char: pcmcia: scr24x_cs: Fix failure handling Handled failure cases of pcmcia_enable_device() and device_create()
@ 2021-05-23 15:11 nizamhaider786
  2021-05-23 15:11 ` [PATCH 2/2] char: pcmcia: scr24x_cs: Fix redundant fops Removed redundant fops assignment, which was already done in cdev_init() nizamhaider786
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: nizamhaider786 @ 2021-05-23 15:11 UTC (permalink / raw)
  To: lkundrak; +Cc: arnd, gregkh, linux-kernel, Nijam Haider

From: Nijam Haider <nizamhaider786@gmail.com>

Signed-off-by: Nijam Haider <nizamhaider786@gmail.com>
---
 drivers/char/pcmcia/scr24x_cs.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/char/pcmcia/scr24x_cs.c b/drivers/char/pcmcia/scr24x_cs.c
index 47feb39..cad1990 100644
--- a/drivers/char/pcmcia/scr24x_cs.c
+++ b/drivers/char/pcmcia/scr24x_cs.c
@@ -233,6 +233,7 @@ static int scr24x_probe(struct pcmcia_device *link)
 {
 	struct scr24x_dev *dev;
 	int ret;
+       struct device *dev_ret;
 
 	dev = kzalloc(sizeof(*dev), GFP_KERNEL);
 	if (!dev)
@@ -272,12 +273,20 @@ static int scr24x_probe(struct pcmcia_device *link)
 
 	ret = pcmcia_enable_device(link);
 	if (ret < 0) {
+	        cdev_del(&dev->c_dev);
 		pcmcia_disable_device(link);
 		goto err;
 	}
 
-	device_create(scr24x_class, NULL, MKDEV(MAJOR(scr24x_devt), dev->devno),
+	dev_ret = device_create(scr24x_class, NULL, MKDEV(MAJOR(scr24x_devt), dev->devno),
 		      NULL, "scr24x%d", dev->devno);
+        if (IS_ERR(dev_ret)) {
+                printk(KERN_ERR "device_create failed for %d\n",
+                               dev->devno);
+                cdev_del(&dev->c_dev);
+                pcmcia_disable_device(link);
+                goto err;
+       }
 
 	dev_info(&link->dev, "SCR24x Chip Card Interface\n");
 	return 0;
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] char: pcmcia: scr24x_cs: Fix redundant fops Removed redundant fops assignment, which was already done in cdev_init()
  2021-05-23 15:11 [PATCH 1/2] char: pcmcia: scr24x_cs: Fix failure handling Handled failure cases of pcmcia_enable_device() and device_create() nizamhaider786
@ 2021-05-23 15:11 ` nizamhaider786
  2021-05-24  7:05   ` Greg KH
  2021-05-24  7:10   ` Lubomir Rintel
  2021-05-24  7:04 ` [PATCH 1/2] char: pcmcia: scr24x_cs: Fix failure handling Handled failure cases of pcmcia_enable_device() and device_create() Greg KH
  2021-05-24  7:14 ` Lubomir Rintel
  2 siblings, 2 replies; 6+ messages in thread
From: nizamhaider786 @ 2021-05-23 15:11 UTC (permalink / raw)
  To: lkundrak; +Cc: arnd, gregkh, linux-kernel, Nijam Haider

From: Nijam Haider <nizamhaider786@gmail.com>

Signed-off-by: Nijam Haider <nizamhaider786@gmail.com>
---
 drivers/char/pcmcia/scr24x_cs.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/char/pcmcia/scr24x_cs.c b/drivers/char/pcmcia/scr24x_cs.c
index cad1990..0265d72 100644
--- a/drivers/char/pcmcia/scr24x_cs.c
+++ b/drivers/char/pcmcia/scr24x_cs.c
@@ -266,7 +266,6 @@ static int scr24x_probe(struct pcmcia_device *link)
 
 	cdev_init(&dev->c_dev, &scr24x_fops);
 	dev->c_dev.owner = THIS_MODULE;
-	dev->c_dev.ops = &scr24x_fops;
 	ret = cdev_add(&dev->c_dev, MKDEV(MAJOR(scr24x_devt), dev->devno), 1);
 	if (ret < 0)
 		goto err;
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] char: pcmcia: scr24x_cs: Fix failure handling Handled failure cases of pcmcia_enable_device() and device_create()
  2021-05-23 15:11 [PATCH 1/2] char: pcmcia: scr24x_cs: Fix failure handling Handled failure cases of pcmcia_enable_device() and device_create() nizamhaider786
  2021-05-23 15:11 ` [PATCH 2/2] char: pcmcia: scr24x_cs: Fix redundant fops Removed redundant fops assignment, which was already done in cdev_init() nizamhaider786
@ 2021-05-24  7:04 ` Greg KH
  2021-05-24  7:14 ` Lubomir Rintel
  2 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2021-05-24  7:04 UTC (permalink / raw)
  To: nizamhaider786; +Cc: lkundrak, arnd, linux-kernel

On Sun, May 23, 2021 at 08:41:10PM +0530, nizamhaider786@gmail.com wrote:
> From: Nijam Haider <nizamhaider786@gmail.com>
> 
> Signed-off-by: Nijam Haider <nizamhaider786@gmail.com>

I can not take patches without any changelog text :(


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] char: pcmcia: scr24x_cs: Fix redundant fops Removed redundant fops assignment, which was already done in cdev_init()
  2021-05-23 15:11 ` [PATCH 2/2] char: pcmcia: scr24x_cs: Fix redundant fops Removed redundant fops assignment, which was already done in cdev_init() nizamhaider786
@ 2021-05-24  7:05   ` Greg KH
  2021-05-24  7:10   ` Lubomir Rintel
  1 sibling, 0 replies; 6+ messages in thread
From: Greg KH @ 2021-05-24  7:05 UTC (permalink / raw)
  To: nizamhaider786; +Cc: lkundrak, arnd, linux-kernel

On Sun, May 23, 2021 at 08:41:11PM +0530, nizamhaider786@gmail.com wrote:
> From: Nijam Haider <nizamhaider786@gmail.com>
> 
> Signed-off-by: Nijam Haider <nizamhaider786@gmail.com>
> ---
>  drivers/char/pcmcia/scr24x_cs.c | 1 -
>  1 file changed, 1 deletion(-)

Hi,

This is the friendly patch-bot of Greg Kroah-Hartman.  You have sent him
a patch that has triggered this response.  He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created.  Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.

You are receiving this message because of the following common error(s)
as indicated below:

- You did not specify a description of why the patch is needed, or
  possibly, any description at all, in the email body.  Please read the
  section entitled "The canonical patch format" in the kernel file,
  Documentation/SubmittingPatches for what is needed in order to
  properly describe the change.

- You did not write a descriptive Subject: for the patch, allowing Greg,
  and everyone else, to know what this patch is all about.  Please read
  the section entitled "The canonical patch format" in the kernel file,
  Documentation/SubmittingPatches for what a proper Subject: line should
  look like.

If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.

thanks,

greg k-h's patch email bot

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] char: pcmcia: scr24x_cs: Fix redundant fops Removed redundant fops assignment, which was already done in cdev_init()
  2021-05-23 15:11 ` [PATCH 2/2] char: pcmcia: scr24x_cs: Fix redundant fops Removed redundant fops assignment, which was already done in cdev_init() nizamhaider786
  2021-05-24  7:05   ` Greg KH
@ 2021-05-24  7:10   ` Lubomir Rintel
  1 sibling, 0 replies; 6+ messages in thread
From: Lubomir Rintel @ 2021-05-24  7:10 UTC (permalink / raw)
  To: nizamhaider786; +Cc: arnd, gregkh, linux-kernel

On Sun, May 23, 2021 at 08:41:11PM +0530, nizamhaider786@gmail.com wrote:
> From: Nijam Haider <nizamhaider786@gmail.com>
> 

Thank you for this. Needs another spin though:

> Subject: [PATCH 2/2] char: pcmcia: scr24x_cs: Fix redundant fops Removed
                                                                  ^
It seems like you accidentally removed a line break here ---------|,
squishing the subject and patch description together.

>  redundant fops assignment, which was already done in cdev_init()

Regards,
Lubo

> Signed-off-by: Nijam Haider <nizamhaider786@gmail.com>
> ---
>  drivers/char/pcmcia/scr24x_cs.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/char/pcmcia/scr24x_cs.c b/drivers/char/pcmcia/scr24x_cs.c
> index cad1990..0265d72 100644
> --- a/drivers/char/pcmcia/scr24x_cs.c
> +++ b/drivers/char/pcmcia/scr24x_cs.c
> @@ -266,7 +266,6 @@ static int scr24x_probe(struct pcmcia_device *link)
>  
>  	cdev_init(&dev->c_dev, &scr24x_fops);
>  	dev->c_dev.owner = THIS_MODULE;
> -	dev->c_dev.ops = &scr24x_fops;
>  	ret = cdev_add(&dev->c_dev, MKDEV(MAJOR(scr24x_devt), dev->devno), 1);
>  	if (ret < 0)
>  		goto err;
> -- 
> 2.7.4
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] char: pcmcia: scr24x_cs: Fix failure handling Handled failure cases of pcmcia_enable_device() and device_create()
  2021-05-23 15:11 [PATCH 1/2] char: pcmcia: scr24x_cs: Fix failure handling Handled failure cases of pcmcia_enable_device() and device_create() nizamhaider786
  2021-05-23 15:11 ` [PATCH 2/2] char: pcmcia: scr24x_cs: Fix redundant fops Removed redundant fops assignment, which was already done in cdev_init() nizamhaider786
  2021-05-24  7:04 ` [PATCH 1/2] char: pcmcia: scr24x_cs: Fix failure handling Handled failure cases of pcmcia_enable_device() and device_create() Greg KH
@ 2021-05-24  7:14 ` Lubomir Rintel
  2 siblings, 0 replies; 6+ messages in thread
From: Lubomir Rintel @ 2021-05-24  7:14 UTC (permalink / raw)
  To: nizamhaider786; +Cc: arnd, gregkh, linux-kernel

> Subject: Re: [PATCH 1/2] char: pcmcia: scr24x_cs: Fix failure handling
>  Handled failure cases of pcmcia_enable_device() and device_create()

Here you also manaded to squish the subject line and the patch
description together. Please break them into two.

On Sun, May 23, 2021 at 08:41:10PM +0530, nizamhaider786@gmail.com wrote:
> From: Nijam Haider <nizamhaider786@gmail.com>
> 
> Signed-off-by: Nijam Haider <nizamhaider786@gmail.com>
> ---
>  drivers/char/pcmcia/scr24x_cs.c | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/char/pcmcia/scr24x_cs.c b/drivers/char/pcmcia/scr24x_cs.c
> index 47feb39..cad1990 100644
> --- a/drivers/char/pcmcia/scr24x_cs.c
> +++ b/drivers/char/pcmcia/scr24x_cs.c
> @@ -233,6 +233,7 @@ static int scr24x_probe(struct pcmcia_device *link)
>  {
>  	struct scr24x_dev *dev;
>  	int ret;
> +       struct device *dev_ret;

Looks like a whitespace error here?

>  	dev = kzalloc(sizeof(*dev), GFP_KERNEL);
>  	if (!dev)
> @@ -272,12 +273,20 @@ static int scr24x_probe(struct pcmcia_device *link)
>  
>  	ret = pcmcia_enable_device(link);
>  	if (ret < 0) {
> +	        cdev_del(&dev->c_dev);

Also here? (a tab followed by spaces).

>  		pcmcia_disable_device(link);
>  		goto err;
>  	}
>  
> -	device_create(scr24x_class, NULL, MKDEV(MAJOR(scr24x_devt), dev->devno),
> +	dev_ret = device_create(scr24x_class, NULL, MKDEV(MAJOR(scr24x_devt), dev->devno),
>  		      NULL, "scr24x%d", dev->devno);
> +        if (IS_ERR(dev_ret)) {
> +                printk(KERN_ERR "device_create failed for %d\n",
> +                               dev->devno);
> +                cdev_del(&dev->c_dev);
> +                pcmcia_disable_device(link);
> +                goto err;
> +       }

...and also here.

In general, please try keeping the formatting consistent with the rest of
the file. Indentation is generally done with tabs.

>  	dev_info(&link->dev, "SCR24x Chip Card Interface\n");
>  	return 0;

Thank you,
Lubo

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-05-24  7:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-23 15:11 [PATCH 1/2] char: pcmcia: scr24x_cs: Fix failure handling Handled failure cases of pcmcia_enable_device() and device_create() nizamhaider786
2021-05-23 15:11 ` [PATCH 2/2] char: pcmcia: scr24x_cs: Fix redundant fops Removed redundant fops assignment, which was already done in cdev_init() nizamhaider786
2021-05-24  7:05   ` Greg KH
2021-05-24  7:10   ` Lubomir Rintel
2021-05-24  7:04 ` [PATCH 1/2] char: pcmcia: scr24x_cs: Fix failure handling Handled failure cases of pcmcia_enable_device() and device_create() Greg KH
2021-05-24  7:14 ` Lubomir Rintel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).