All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lubomir Rintel <lkundrak@v3.sk>
To: nizamhaider786@gmail.com
Cc: arnd@arndb.de, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] char: pcmcia: scr24x_cs: Fix failure handling Handled failure cases of pcmcia_enable_device() and device_create()
Date: Mon, 24 May 2021 09:14:18 +0200	[thread overview]
Message-ID: <YKtSSiSNEKx6h1Pp@demiurge.local> (raw)
In-Reply-To: <20210523151111.2968-1-nizamhaider786@gmail.com>

> 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

      parent reply	other threads:[~2021-05-24  7:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YKtSSiSNEKx6h1Pp@demiurge.local \
    --to=lkundrak@v3.sk \
    --cc=arnd@arndb.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nizamhaider786@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.