mlxreg_dpu
mlxreg_dpu_copy_hotplug_data(struct device *dev, struct mlxreg_dpu *mlxreg_dpu,
mlxreg_dpu->hotplug_data = devm_kmemdup(dev, hotplug_data,
sizeof(*mlxreg_dpu->hotplug_data), GFP_KERNEL);
if (!mlxreg_dpu->hotplug_data)
mlxreg_dpu->hotplug_data->items = devm_kmemdup(dev, hotplug_data->items,
mlxreg_dpu->hotplug_data->count *
sizeof(*mlxreg_dpu->hotplug_data->items),
if (!mlxreg_dpu->hotplug_data->items)
item = mlxreg_dpu->hotplug_data->items;
static int mlxreg_dpu_config_init(struct mlxreg_dpu *mlxreg_dpu, void *regmap,
err = mlxreg_dpu_copy_hotplug_data(dev, mlxreg_dpu,
mlxreg_dpu->io_data = &mlxreg_dpu_default_regs_io_data;
if (mlxreg_dpu->io_data) {
mlxreg_dpu->io_data->regmap = regmap;
mlxreg_dpu->io_regs =
mlxreg_dpu->io_data,
sizeof(*mlxreg_dpu->io_data));
if (IS_ERR(mlxreg_dpu->io_regs)) {
return PTR_ERR(mlxreg_dpu->io_regs);
if (mlxreg_dpu->hotplug_data && irq) {
mlxreg_dpu->hotplug_data->regmap = regmap;
mlxreg_dpu->hotplug_data->irq = irq;
mlxreg_dpu->hotplug =
mlxreg_dpu->hotplug_data,
sizeof(*mlxreg_dpu->hotplug_data));
if (IS_ERR(mlxreg_dpu->hotplug)) {
err = PTR_ERR(mlxreg_dpu->hotplug);
platform_device_unregister(mlxreg_dpu->io_regs);
static void mlxreg_dpu_config_exit(struct mlxreg_dpu *mlxreg_dpu)
platform_device_unregister(mlxreg_dpu->hotplug);
platform_device_unregister(mlxreg_dpu->io_regs);
struct mlxreg_dpu *mlxreg_dpu;
mlxreg_dpu = devm_kzalloc(&pdev->dev, sizeof(*mlxreg_dpu), GFP_KERNEL);
if (!mlxreg_dpu) {
mlxreg_dpu->data = data;
mlxreg_dpu->dev = &pdev->dev;
platform_set_drvdata(pdev, mlxreg_dpu);
err = mlxreg_dpu_config_init(mlxreg_dpu, regmap, data, data->hpdev.brdinfo->irq);
struct mlxreg_dpu *mlxreg_dpu = platform_get_drvdata(pdev);
mlxreg_dpu_config_exit(mlxreg_dpu);