|
@@ -75,15 +75,16 @@ static int pld_sdio_probe(struct sdio_func *sdio_func,
|
|
|
const struct sdio_device_id *id)
|
|
|
{
|
|
|
struct pld_context *pld_context;
|
|
|
- struct device *dev = &sdio_func->dev;
|
|
|
- int ret = 0;
|
|
|
+ struct device *dev;
|
|
|
+ int ret;
|
|
|
|
|
|
pld_context = pld_get_global_context();
|
|
|
- if (!pld_context) {
|
|
|
+ if (!pld_context || !sdio_func) {
|
|
|
ret = -ENODEV;
|
|
|
goto out;
|
|
|
}
|
|
|
|
|
|
+ dev = &sdio_func->dev;
|
|
|
ret = pld_add_dev(pld_context, dev, PLD_BUS_TYPE_SDIO);
|
|
|
if (ret)
|
|
|
goto out;
|