lkml.org 
[lkml]   [2014]   [Aug]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/3] fpga bus driver
Hi!

> Here's a simple example. Start with:
> * the altera-gpio driver built in to the kernel but not in the
> device tree.
> * raw fpga image at /lib/firmware/soc_system.rbf
> * Load appropriate device tree overlay in configfs by doing
> $ mkdir /config/device-tree/overlays/1
> $ echo socfpga_overlay.dtbo > /config/device-tree/overlays/1/path
> * This results in the FPGA getting programmed and the altera
> gpio driver getting probed.

Nice!

> +/* Find the fpga manager that is pointed to by a phandle */
> +struct fpga_manager *of_fpga_mgr_dev_lookup(struct device_node *node,
> + const char *mgr_property,
> + int *ret)
> +{
> + struct fpga_manager *mgr;
> + struct device_node *mgr_node;
> +
> + mgr_node = of_parse_phandle(node, mgr_property, 0);
> +
> + if (!mgr_node) {
> + *ret = -ENODEV;
> + return NULL;

Could IS_ERR_OR_NULL() and friends be used to get reasonable calling
convention?

Thanks,
Pavel

--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


\
 
 \ /
  Last update: 2014-08-02 03:01    [W:0.081 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site