Commit ebd1e2b0 authored by Federico Vaga's avatar Federico Vaga

sw:drv: assign platform_device id automatically

Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent b63cd010
......@@ -19,12 +19,6 @@
#include "platform_data/spi-ocores.h"
/* FIXME find better ID */
static int vic_id;
static int mfd_id;
static int app_id;
enum spec_fpga_mem_offsets {
SPEC_FPGA_MEM_CSR_START = SPEC_CORE_FPGA + 0x40,
SPEC_FPGA_MEM_CSR_END = SPEC_CORE_FPGA + 0x5F,
......@@ -239,7 +233,8 @@ static int spec_fpga_vic_init(struct spec_fpga *spec_fpga)
res[1].start = gpiod_to_irq(spec_gn412x->gpiod[GN4124_GPIO_IRQ1]);
res[1].end = res[1].start;
pdev = platform_device_register_resndata(&spec_fpga->dev,
"htvic-spec", vic_id++,
"htvic-spec",
PLATFORM_DEVID_AUTO,
res, res_n,
NULL, 0);
if (IS_ERR(pdev))
......@@ -379,7 +374,8 @@ static int spec_fpga_devices_init(struct spec_fpga *spec_fpga)
fpga_mfd_devs[0].num_resources = 1; /* FMC I2C */
fpga_mfd_devs[1].num_resources = 1; /* SPI */
}
err = mfd_add_devices(&spec_fpga->dev, mfd_id++,
err = mfd_add_devices(&spec_fpga->dev,
PLATFORM_DEVID_AUTO,
fpga_mfd_devs, n_mfd,
&pcidev->resource[0],
0, vic_domain);
......@@ -640,7 +636,7 @@ static int spec_fpga_app_init(struct spec_fpga *spec_fpga)
spec_fpga_app_id_build(spec_fpga, SPEC_FPGA_CSR_APP_OFF,
app_name, SPEC_FPGA_APP_NAME_MAX);
pdev = platform_device_register_resndata(&spec_fpga->dev,
app_name, app_id++,
app_name, PLATFORM_DEVID_AUTO,
res, res_n,
NULL, 0);
if (IS_ERR(pdev))
......
......@@ -20,8 +20,6 @@
#include "spec.h"
#include "spec-compat.h"
static int mfd_id; /* FIXME look for something better */
static char *spec_fw_name_45t = "spec-golden-45T.bin";
static char *spec_fw_name_100t = "spec-golden-100T.bin";
static char *spec_fw_name_150t = "spec-golden-150T.bin";
......@@ -601,7 +599,7 @@ static int spec_probe(struct pci_dev *pdev,
}
pci_set_master(pdev);
err = mfd_add_devices(&pdev->dev, mfd_id++,
err = mfd_add_devices(&pdev->dev, PLATFORM_DEVID_AUTO,
spec_mfd_devs,
ARRAY_SIZE(spec_mfd_devs),
&pdev->resource[4], pdev->irq, NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment