public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Ismael Luceno <ismael@iodev.co.uk>
To: khalasa@piap.pl (Krzysztof Hałasa)
Cc: linux-media <linux-media@vger.kernel.org>
Subject: Re: [PATCH] SOLO6x10: Remove dead code.
Date: Sun, 14 Jun 2015 18:53:17 -0300	[thread overview]
Message-ID: <20150614185317.48b59f39@pirotess> (raw)
In-Reply-To: <m3pp56wbq9.fsf@t19.piap.pl>

On Mon, 08 Jun 2015 15:50:22 +0200
khalasa@piap.pl (Krzysztof Hałasa) wrote:
> solo_dev and pdev cannot be NULL here. It doesn't matter if we
> initialized the PCI device or not.
> 
> Signed-off-by: Krzysztof Hałasa <khalasa@piap.pl>
> 
> --- a/drivers/media/pci/solo6x10/solo6x10-core.c
> +++ b/drivers/media/pci/solo6x10/solo6x10-core.c
> @@ -134,23 +134,11 @@ static irqreturn_t solo_isr(int irq, void *data)
>  
>  static void free_solo_dev(struct solo_dev *solo_dev)
>  {
> -	struct pci_dev *pdev;
> -
> -	if (!solo_dev)
> -		return;
> +	struct pci_dev *pdev = solo_dev->pdev;
>  
>  	if (solo_dev->dev.parent)
>  		device_unregister(&solo_dev->dev);
>  
> -	pdev = solo_dev->pdev;
> -
> -	/* If we never initialized the PCI device, then nothing else
> -	 * below here needs cleanup */
> -	if (!pdev) {
> -		kfree(solo_dev);
> -		return;
> -	}
> -
>  	if (solo_dev->reg_base) {
>  		/* Bring down the sub-devices first */
>  		solo_g723_exit(solo_dev);
> @@ -164,8 +152,7 @@ static void free_solo_dev(struct solo_dev
> *solo_dev) 
>  		/* Now cleanup the PCI device */
>  		solo_irq_off(solo_dev, ~0);
> -		if (pdev->irq)
> -			free_irq(pdev->irq, solo_dev);
> +		free_irq(pdev->irq, solo_dev);
>  		pci_iounmap(pdev, solo_dev->reg_base);
>  	}
>  

Signed-off-by: Ismael Luceno <ismael@iodev.co.uk>

  reply	other threads:[~2015-06-14 22:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-08 13:30 A few SOLO6x10 patches Krzysztof Hałasa
2015-06-08 13:35 ` [PATCH] SOLO6x10: Fix G.723 minimum audio period count Krzysztof Hałasa
2015-06-14 21:51   ` Ismael Luceno
2015-06-08 13:37 ` [PATCH] SOLO6x10: unmap registers only after free_irq() Krzysztof Hałasa
2015-06-14 21:52   ` Ismael Luceno
2015-06-08 13:42 ` [PATCH] SOLO6x10: remove unneeded register locking and barriers Krzysztof Hałasa
2015-06-14 21:53   ` Ismael Luceno
2015-06-08 13:50 ` [PATCH] SOLO6x10: Remove dead code Krzysztof Hałasa
2015-06-14 21:53   ` Ismael Luceno [this message]
2015-06-14 21:50 ` A few SOLO6x10 patches Ismael Luceno

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=20150614185317.48b59f39@pirotess \
    --to=ismael@iodev.co.uk \
    --cc=khalasa@piap.pl \
    --cc=linux-media@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox