fpga: mgr: Use standard dev_release for class driver
authorRuss Weight <russell.h.weight@intel.com>
Fri, 19 Nov 2021 01:55:51 +0000 (17:55 -0800)
committerMoritz Fischer <mdf@kernel.org>
Sun, 28 Nov 2021 21:59:13 +0000 (13:59 -0800)
commit4ba0b2c294fe691921271372f7b59e5cc2ce4b0f
tree720bcf39730f09c5ff63195820771fad77326389
parentfa55b7dcdc43c1aa1ba12bca9d2dd4318c2a0dbf
fpga: mgr: Use standard dev_release for class driver

The FPGA manager class driver data structure is being treated as a
managed resource instead of using the standard dev_release call-back
function to release the class data structure. This change removes
the managed resource code for the freeing of the class data structure
and combines the create() and register() functions into a single
register() or register_full() function.

The register_full() function accepts an info data structure to provide
flexibility in passing optional parameters. The register() function
supports the current parameter list for users that don't require the
use of optional parameters.

The devm_fpga_mgr_register() function is retained, and the
devm_fpga_mgr_register_full() function is added.

Signed-off-by: Russ Weight <russell.h.weight@intel.com>
Reviewed-by: Xu Yilun <yilun.xu@intel.com>
Acked-by: Xu Yilun <yilun.xu@intel.com>
Signed-off-by: Moritz Fischer <mdf@kernel.org>
17 files changed:
Documentation/driver-api/fpga/fpga-mgr.rst
drivers/fpga/altera-cvp.c
drivers/fpga/altera-pr-ip-core.c
drivers/fpga/altera-ps-spi.c
drivers/fpga/dfl-fme-mgr.c
drivers/fpga/fpga-mgr.c
drivers/fpga/ice40-spi.c
drivers/fpga/machxo2-spi.c
drivers/fpga/socfpga-a10.c
drivers/fpga/socfpga.c
drivers/fpga/stratix10-soc.c
drivers/fpga/ts73xx-fpga.c
drivers/fpga/versal-fpga.c
drivers/fpga/xilinx-spi.c
drivers/fpga/zynq-fpga.c
drivers/fpga/zynqmp-fpga.c
include/linux/fpga/fpga-mgr.h