Skip to content

Commit

Permalink
media: ipu3-cio2: Call cio2_bridge_init() before anything else
Browse files Browse the repository at this point in the history
Since cio2_bridge_init() may now return -EPROBE_DEFER it is best to
call it before anything else.

Signed-off-by: Hans de Goede <[email protected]>
Signed-off-by: Sakari Ailus <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
jwrdegoede authored and mchehab committed Dec 16, 2021
1 parent ae971cc commit fc2c204
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions drivers/media/pci/intel/ipu3/ipu3-cio2-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1713,11 +1713,6 @@ static int cio2_pci_probe(struct pci_dev *pci_dev,
struct cio2_device *cio2;
int r;

cio2 = devm_kzalloc(dev, sizeof(*cio2), GFP_KERNEL);
if (!cio2)
return -ENOMEM;
cio2->pci_dev = pci_dev;

/*
* On some platforms no connections to sensors are defined in firmware,
* if the device has no endpoints then we can try to build those as
Expand All @@ -1735,6 +1730,11 @@ static int cio2_pci_probe(struct pci_dev *pci_dev,
return r;
}

cio2 = devm_kzalloc(dev, sizeof(*cio2), GFP_KERNEL);
if (!cio2)
return -ENOMEM;
cio2->pci_dev = pci_dev;

r = pcim_enable_device(pci_dev);
if (r) {
dev_err(dev, "failed to enable device (%d)\n", r);
Expand Down

0 comments on commit fc2c204

Please sign in to comment.