Skip to content

Commit 4e448e6

Browse files
author
Fox Snowpatch
committed
1 parent 7beb771 commit 4e448e6

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

drivers/macintosh/via-pmu-led.c

+10-9
Original file line numberDiff line numberDiff line change
@@ -92,18 +92,15 @@ static int __init via_pmu_led_init(void)
9292
if (dt == NULL)
9393
return -ENODEV;
9494
model = of_get_property(dt, "model", NULL);
95-
if (model == NULL) {
96-
of_node_put(dt);
97-
return -ENODEV;
98-
}
95+
if (!model)
96+
goto put_node;
97+
9998
if (strncmp(model, "PowerBook", strlen("PowerBook")) != 0 &&
10099
strncmp(model, "iBook", strlen("iBook")) != 0 &&
101100
strcmp(model, "PowerMac7,2") != 0 &&
102-
strcmp(model, "PowerMac7,3") != 0) {
103-
of_node_put(dt);
104-
/* ignore */
105-
return -ENODEV;
106-
}
101+
strcmp(model, "PowerMac7,3") != 0)
102+
goto put_node;
103+
107104
of_node_put(dt);
108105

109106
spin_lock_init(&pmu_blink_lock);
@@ -112,6 +109,10 @@ static int __init via_pmu_led_init(void)
112109
pmu_blink_req.done = pmu_req_done;
113110

114111
return led_classdev_register(NULL, &pmu_led);
112+
113+
put_node:
114+
of_node_put(dt);
115+
return -ENODEV;
115116
}
116117

117118
late_initcall(via_pmu_led_init);

0 commit comments

Comments
 (0)