diff mbox

SOLO6x10: Remove dead code.

Message ID m3pp56wbq9.fsf@t19.piap.pl (mailing list archive)
State New, archived
Headers show

Commit Message

Krzysztof HaƂasa June 8, 2015, 1:50 p.m. UTC
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>

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Ismael Luceno June 14, 2015, 9:53 p.m. UTC | #1
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>
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

--- 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);
 	}