| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Common code for Freescale MMA955x Intelligent Sensor Platform drivers |
|---|
| 3 | 4 | * Copyright (c) 2014, Intel Corporation. |
|---|
| 4 | | - * |
|---|
| 5 | | - * This program is free software; you can redistribute it and/or modify it |
|---|
| 6 | | - * under the terms and conditions of the GNU General Public License, |
|---|
| 7 | | - * version 2, as published by the Free Software Foundation. |
|---|
| 8 | | - * |
|---|
| 9 | | - * This program is distributed in the hope it will be useful, but WITHOUT |
|---|
| 10 | | - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|---|
| 11 | | - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
|---|
| 12 | | - * more details. |
|---|
| 13 | 5 | */ |
|---|
| 14 | 6 | |
|---|
| 15 | 7 | #include <linux/module.h> |
|---|
| .. | .. |
|---|
| 304 | 296 | |
|---|
| 305 | 297 | ret = mma9551_transfer(client, app_id, MMA9551_CMD_READ_CONFIG, |
|---|
| 306 | 298 | reg, NULL, 0, (u8 *)&v, 2); |
|---|
| 299 | + if (ret < 0) |
|---|
| 300 | + return ret; |
|---|
| 301 | + |
|---|
| 307 | 302 | *val = be16_to_cpu(v); |
|---|
| 308 | 303 | |
|---|
| 309 | | - return ret; |
|---|
| 304 | + return 0; |
|---|
| 310 | 305 | } |
|---|
| 311 | 306 | EXPORT_SYMBOL(mma9551_read_config_word); |
|---|
| 312 | 307 | |
|---|
| .. | .. |
|---|
| 362 | 357 | |
|---|
| 363 | 358 | ret = mma9551_transfer(client, app_id, MMA9551_CMD_READ_STATUS, |
|---|
| 364 | 359 | reg, NULL, 0, (u8 *)&v, 2); |
|---|
| 360 | + if (ret < 0) |
|---|
| 361 | + return ret; |
|---|
| 362 | + |
|---|
| 365 | 363 | *val = be16_to_cpu(v); |
|---|
| 366 | 364 | |
|---|
| 367 | | - return ret; |
|---|
| 365 | + return 0; |
|---|
| 368 | 366 | } |
|---|
| 369 | 367 | EXPORT_SYMBOL(mma9551_read_status_word); |
|---|
| 370 | 368 | |
|---|