]> www.infradead.org Git - linux.git/commitdiff
power: supply: rk817: remove redundant null check on node
authorColin Ian King <colin.i.king@gmail.com>
Wed, 19 Mar 2025 10:51:53 +0000 (10:51 +0000)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Tue, 8 Apr 2025 20:46:49 +0000 (22:46 +0200)
The pointer null is being null checked immediately after it has
been assigned at the start of the function and not changed afterwards.
The subsequent null check on node is redudant and can be removed.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Link: https://lore.kernel.org/r/20250319105153.775155-1-colin.i.king@gmail.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/rk817_charger.c

index 945c7720c4ae905e2f0204cbef1534f7ec2a3a62..1251022eb052c1fdc76c45102b5517710e3692df 100644 (file)
@@ -1088,7 +1088,7 @@ static int rk817_charger_probe(struct platform_device *pdev)
        rk817_bat_calib_vol(charger);
 
        pscfg.drv_data = charger;
-       pscfg.fwnode = node ? &node->fwnode : NULL;
+       pscfg.fwnode = &node->fwnode;
 
        /*
         * Get sample resistor value. Note only values of 10000 or 20000