Skip to content

Commit

Permalink
staging: vchiq_2835_arm: Make cache-line-size a required DT property
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Michael Zoran authored and Greg Kroah-Hartman committed Feb 26, 2017
1 parent f4082c6 commit 6cf1bf6
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,14 @@ int vchiq_platform_init(struct platform_device *pdev, VCHIQ_STATE_T *state)
if (err < 0)
return err;

(void)of_property_read_u32(dev->of_node, "cache-line-size",
err = of_property_read_u32(dev->of_node, "cache-line-size",
&g_cache_line_size);

if (err) {
dev_err(dev, "Missing cache-line-size property\n");
return -ENODEV;
}

g_fragments_size = 2 * g_cache_line_size;

/* Allocate space for the channels in coherent memory */
Expand Down

0 comments on commit 6cf1bf6

Please sign in to comment.