Skip to content

Commit

Permalink
tpm/tpm_atmel: remove unnecessary NULL check
Browse files Browse the repository at this point in the history
Remove unnecessary NULL check.
Pointer _chip_ cannot be NULL in this instance.

Signed-off-by: Gustavo A. R. Silva <[email protected]>
Reviewed-by: Jarkko Sakkinen <[email protected]>
Tested-by: Jarkko Sakkinen <[email protected]> (compilation)
Signed-off-by: Jarkko Sakkinen <[email protected]>
  • Loading branch information
GustavoARSilva authored and Jarkko Sakkinen committed Jun 19, 2017
1 parent 23c3bea commit e4b0852
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions drivers/char/tpm/tpm_atmel.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,11 @@ static void atml_plat_remove(void)
struct tpm_chip *chip = dev_get_drvdata(&pdev->dev);
struct tpm_atmel_priv *priv = dev_get_drvdata(&chip->dev);

if (chip) {
tpm_chip_unregister(chip);
if (priv->have_region)
atmel_release_region(priv->base, priv->region_size);
atmel_put_base_addr(priv->iobase);
platform_device_unregister(pdev);
}
tpm_chip_unregister(chip);
if (priv->have_region)
atmel_release_region(priv->base, priv->region_size);
atmel_put_base_addr(priv->iobase);
platform_device_unregister(pdev);
}

static SIMPLE_DEV_PM_OPS(tpm_atml_pm, tpm_pm_suspend, tpm_pm_resume);
Expand Down

0 comments on commit e4b0852

Please sign in to comment.