Re: [RESEND PATCH v3 2/4] fpga: manager: don't use drvdata in common fpga code

From: Alan Tull
Date: Tue Mar 27 2018 - 17:20:07 EST


On Tue, Mar 27, 2018 at 3:11 PM, Moritz Fischer
<moritz.fischer@xxxxxxxxx> wrote:
> On Tue, Mar 27, 2018 at 12:59 PM, Alan Tull <atull@xxxxxxxxxx> wrote:
>> Change fpga_mgr_register to not set or use drvdata.
>>
>> Change the register/unregister function parameters to take the mgr
>> struct:
>> * int fpga_mgr_register(struct fpga_manager *mgr);
>> * void fpga_mgr_unregister(struct fpga_manager *mgr);
>>
>> Change the drivers that call fpga_mgr_register to alloc the struct
>> fpga_manager (using devm_kzalloc) and partly fill it, adding name,
>> ops, parent device, and priv.
>>
>> The rationale is that setting drvdata is fine for DT based devices
>> that will have one manager, bridge, or region per platform device.
>> However PCIe based devices may have multiple FPGA mgr/bridge/regions
>> under one PCIe device. Without these changes, the PCIe solution has
>> to create an extra device for each child mgr/bridge/region to hold
>> drvdata.
>>
>> Signed-off-by: Alan Tull <atull@xxxxxxxxxx>
>> Reported-by: Jiuyue Ma <majiuyue@xxxxxxxxxx>
> Acked-by: Moritz Fischer <mdf@xxxxxxxxxx>

Thanks Moritz!

Alan