|
@@ -371,10 +371,15 @@ acpi_i2c_space_handler(u32 function, acpi_physical_address command,
|
|
|
|
|
|
static int acpi_i2c_install_space_handler(struct i2c_adapter *adapter)
|
|
static int acpi_i2c_install_space_handler(struct i2c_adapter *adapter)
|
|
{
|
|
{
|
|
- acpi_handle handle = ACPI_HANDLE(adapter->dev.parent);
|
|
|
|
|
|
+ acpi_handle handle;
|
|
struct acpi_i2c_handler_data *data;
|
|
struct acpi_i2c_handler_data *data;
|
|
acpi_status status;
|
|
acpi_status status;
|
|
|
|
|
|
|
|
+ if (!adapter->dev.parent)
|
|
|
|
+ return -ENODEV;
|
|
|
|
+
|
|
|
|
+ handle = ACPI_HANDLE(adapter->dev.parent);
|
|
|
|
+
|
|
if (!handle)
|
|
if (!handle)
|
|
return -ENODEV;
|
|
return -ENODEV;
|
|
|
|
|
|
@@ -407,10 +412,15 @@ static int acpi_i2c_install_space_handler(struct i2c_adapter *adapter)
|
|
|
|
|
|
static void acpi_i2c_remove_space_handler(struct i2c_adapter *adapter)
|
|
static void acpi_i2c_remove_space_handler(struct i2c_adapter *adapter)
|
|
{
|
|
{
|
|
- acpi_handle handle = ACPI_HANDLE(adapter->dev.parent);
|
|
|
|
|
|
+ acpi_handle handle;
|
|
struct acpi_i2c_handler_data *data;
|
|
struct acpi_i2c_handler_data *data;
|
|
acpi_status status;
|
|
acpi_status status;
|
|
|
|
|
|
|
|
+ if (!adapter->dev.parent)
|
|
|
|
+ return;
|
|
|
|
+
|
|
|
|
+ handle = ACPI_HANDLE(adapter->dev.parent);
|
|
|
|
+
|
|
if (!handle)
|
|
if (!handle)
|
|
return;
|
|
return;
|
|
|
|
|