Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

i2c-amd756-s4882: Fix an error path

If initialization fails, we want to restore the physical bus, not delete
it again.

Signed-off-by: Jean Delvare <khali@linux-fr.org>

authored by

Jean Delvare and committed by
Jean Delvare
ee56d977 306f39f8

+3 -2
+3 -2
drivers/i2c/busses/i2c-amd756-s4882.c
··· 1 1 /* 2 2 * i2c-amd756-s4882.c - i2c-amd756 extras for the Tyan S4882 motherboard 3 3 * 4 - * Copyright (C) 2004 Jean Delvare <khali@linux-fr.org> 4 + * Copyright (C) 2004, 2008 Jean Delvare <khali@linux-fr.org> 5 5 * 6 6 * This program is free software; you can redistribute it and/or modify 7 7 * it under the terms of the GNU General Public License as published by ··· 231 231 kfree(s4882_adapter); 232 232 s4882_adapter = NULL; 233 233 ERROR1: 234 - i2c_del_adapter(&amd756_smbus); 234 + /* Restore physical bus */ 235 + i2c_add_adapter(&amd756_smbus); 235 236 ERROR0: 236 237 return error; 237 238 }