Re: [tpmdd-devel] [PATCH 1/1] TPM: STMicroelectronics ST33 I2C KERNEL 3.x.x OOPS!

From: Peter Hüwe
Date: Wed Jan 09 2013 - 14:38:41 EST


Hi,

> Do you have the I2C configuration activated ?
> I have this error when I add the driver in a kernel with no I2C activated

I2C works fine on my beaglebone, however I did not add the platform data to my
boardfile.
a) as I don't use board files anymore but device trees ;)
b) it's perfectly legit to load a driver without the platform data and probe
it at runtime (which then in doubt fails to probe).

In my opinion a driver should never ever oops, even if the user does something
stupid (e.g. like probing from userspace ;)

The fix is as simple as adding a simple
if (!platform_data) return -ENODEV;
or something similar.

Thanks,
Peter

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/