GPIO,I2C: Better error handling.

Signed-off-by: matematik7 <domen.ipavec@z-v.si>