Skip to content

Commit 6cf1bf6

Browse files
Electron752gregkh
authored andcommitted
staging: vchiq_2835_arm: Make cache-line-size a required DT property
The original github source allowed for the cache-line-size property to be missing. Since recent firmwares also require this property, it makes sense to always require it in the driver as well. If the cache-line-size property is missing, then the driver probe should fail as no dev since the kernel and dt may be out of sync. The fix is to add a check for the return value of of_property_read_u32. Changes V2: 1. Add error message if cache-line-size is missing. 2. Simple check for non-zero return value from of_property_read_u32. Signed-off-by: Michael Zoran <mzoran@crowfest.net> Acked-by: Stefan Wahren <stefan.wahren@i2se.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent f4082c6 commit 6cf1bf6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,14 @@ int vchiq_platform_init(struct platform_device *pdev, VCHIQ_STATE_T *state)
121121
if (err < 0)
122122
return err;
123123

124-
(void)of_property_read_u32(dev->of_node, "cache-line-size",
124+
err = of_property_read_u32(dev->of_node, "cache-line-size",
125125
&g_cache_line_size);
126+
127+
if (err) {
128+
dev_err(dev, "Missing cache-line-size property\n");
129+
return -ENODEV;
130+
}
131+
126132
g_fragments_size = 2 * g_cache_line_size;
127133

128134
/* Allocate space for the channels in coherent memory */

0 commit comments

Comments
 (0)