treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / arch / x86 / platform / intel-mid / device_libs / platform_lis331.c
bloba4485cd638c690f6717400962523ace5b35f0012
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3 * platform_lis331.c: lis331 platform data initialization file
5 * (C) Copyright 2013 Intel Corporation
6 * Author: Sathyanarayanan Kuppuswamy <sathyanarayanan.kuppuswamy@intel.com>
7 */
9 #include <linux/i2c.h>
10 #include <linux/gpio.h>
11 #include <asm/intel-mid.h>
13 static void __init *lis331dl_platform_data(void *info)
15 static short intr2nd_pdata;
16 struct i2c_board_info *i2c_info = info;
17 int intr = get_gpio_by_name("accel_int");
18 int intr2nd = get_gpio_by_name("accel_2");
20 if (intr < 0)
21 return NULL;
22 if (intr2nd < 0)
23 return NULL;
25 i2c_info->irq = intr + INTEL_MID_IRQ_OFFSET;
26 intr2nd_pdata = intr2nd + INTEL_MID_IRQ_OFFSET;
28 return &intr2nd_pdata;
31 static const struct devs_id lis331dl_dev_id __initconst = {
32 .name = "i2c_accel",
33 .type = SFI_DEV_TYPE_I2C,
34 .get_platform_data = &lis331dl_platform_data,
37 sfi_device(lis331dl_dev_id);