Commit 3a544ebf authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Jakub Kicinski
Browse files

ptp_ocp: drop duplicate NULL check in ptp_ocp_detach()



Since platform_device_unregister() is NULL-aware, we don't need to duplicate
this check. Remove it and fold the rest of the code.

Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: default avatarVadim Fedorenko <vfedorenko@novek.ru>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 1132bb29
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -3701,9 +3701,7 @@ ptp_ocp_detach(struct ptp_ocp *bp)
		serial8250_unregister_port(bp->mac_port);
	if (bp->nmea_port != -1)
		serial8250_unregister_port(bp->nmea_port);
	if (bp->spi_flash)
	platform_device_unregister(bp->spi_flash);
	if (bp->i2c_ctrl)
	platform_device_unregister(bp->i2c_ctrl);
	if (bp->i2c_clk)
		clk_hw_unregister_fixed_rate(bp->i2c_clk);