Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750992AbdCNHfR (ORCPT ); Tue, 14 Mar 2017 03:35:17 -0400 Received: from 219-80-251-49.static.tfn.net.tw ([219.80.251.49]:19192 "EHLO mse1.corp.rad-ic.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750944AbdCNHfP (ORCPT ); Tue, 14 Mar 2017 03:35:15 -0400 X-Greylist: delayed 2931 seconds by postgrey-1.27 at vger.kernel.org; Tue, 14 Mar 2017 03:35:14 EDT From: =?utf-8?B?SmVmZnJleSBMaW4gKOael+e+qeeroCk=?= To: Guenter Roeck , Dmitry Torokhov CC: "linux-input@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Colin Ian King , Rob Herring Subject: RE: [PATCH 30/33] Input: raydium_i2c_ts - Simplify error return and other changes Thread-Topic: [PATCH 30/33] Input: raydium_i2c_ts - Simplify error return and other changes Thread-Index: AQHSccqrk+a8qK+O70eDmla3BfXIIKGUNf9g Date: Tue, 14 Mar 2017 06:43:58 +0000 Message-ID: <9BE4B49389AB2F41A64A32DFC844F1DF74CC8ADF@RADHCMS5.corp.rad-ic.com> References: <1484761614-12225-1-git-send-email-linux@roeck-us.net> <1484771819-13761-1-git-send-email-linux@roeck-us.net> In-Reply-To: <1484771819-13761-1-git-send-email-linux@roeck-us.net> Accept-Language: zh-TW, en-US Content-Language: zh-TW X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [192.168.16.134] Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 X-MAIL: mse1.corp.rad-ic.com v2E6j8hD052598 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id v2E7ZQ4m019285 Content-Length: 4208 Lines: 97 Hi sirs: We're found raydium I2C driver not been kernel version v4.4, just found in v3.18. Should I commit again to V4.4?? Best Regards ---------------------------------------------------------------------- Jeffrey Lin,林義章 瑞鼎科技 Raydium Semiconductor Corporation Tel:(03)666-1818 Ext.4163 Fax:(03)666-1919 -----Original Message----- From: Guenter Roeck [mailto:linux@roeck-us.net] Sent: Thursday, January 19, 2017 4:37 AM To: Dmitry Torokhov Cc: linux-input@vger.kernel.org; linux-kernel@vger.kernel.org; Guenter Roeck; Colin Ian King; Jeffrey Lin (林義章); Rob Herring Subject: [PATCH 30/33] Input: raydium_i2c_ts - Simplify error return and other changes Simplify error return if the code returns anyway. Other relevant changes: Replace devm_add_action() with devm_add_action_or_reset() This conversion was done automatically with coccinelle using the following semantic patches. The semantic patches and the scripts used to generate this commit log are available at https://github.com/groeck/coccinelle-patches - Replace devm_add_action() followed by failure action with devm_add_action_or_reset() - Replace 'goto l; ... l: return e;' with 'return e;' - Replace 'if (e) return e; return 0;' with 'return e;' Signed-off-by: Guenter Roeck --- drivers/input/touchscreen/raydium_i2c_ts.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/input/touchscreen/raydium_i2c_ts.c b/drivers/input/touchscreen/raydium_i2c_ts.c index 2658afa016c9..84507a882fa1 100644 --- a/drivers/input/touchscreen/raydium_i2c_ts.c +++ b/drivers/input/touchscreen/raydium_i2c_ts.c @@ -741,11 +741,7 @@ static int raydium_i2c_do_update_firmware(struct raydium_data *ts, fw_checksum = raydium_calc_chksum(fw->data, fw->size); - error = raydium_i2c_write_checksum(client, fw->size, fw_checksum); - if (error) - return error; - - return 0; + return raydium_i2c_write_checksum(client, fw->size, fw_checksum); } static int raydium_i2c_fw_update(struct raydium_data *ts) @@ -831,12 +827,12 @@ static irqreturn_t raydium_i2c_irq(int irq, void *_dev) u16 calc_crc; if (ts->boot_mode != RAYDIUM_TS_MAIN) - goto out; + return IRQ_HANDLED; error = raydium_i2c_read_message(ts->client, ts->data_bank_addr, ts->report_data, ts->pkg_size); if (error) - goto out; + return IRQ_HANDLED; fw_crc = get_unaligned_le16(&ts->report_data[ts->report_size]); calc_crc = raydium_calc_chksum(ts->report_data, ts->report_size); @@ -844,12 +840,11 @@ static irqreturn_t raydium_i2c_irq(int irq, void *_dev) dev_warn(&ts->client->dev, "%s: invalid packet crc %#04x vs %#04x\n", __func__, calc_crc, fw_crc); - goto out; + return IRQ_HANDLED; } raydium_mt_event(ts); -out: return IRQ_HANDLED; } @@ -1130,10 +1125,9 @@ static int raydium_i2c_probe(struct i2c_client *client, return error; } - error = devm_add_action(&client->dev, - raydium_i2c_remove_sysfs_group, ts); + error = devm_add_action_or_reset(&client->dev, + raydium_i2c_remove_sysfs_group, ts); if (error) { - raydium_i2c_remove_sysfs_group(ts); dev_err(&client->dev, "Failed to add sysfs cleanup action: %d\n", error); return error; -- 2.7.4 CONFIDENTIALITY AND PROPRIETARY REMINDER: This message and any attachment may contain confidential information. All rights including intellectual property rights arising out of this correspondence shall belong to Raydium Semiconductor Corp. Any unauthorized disclosure, forwarding, using, modifying, spreading, publishing or copying this email and the content is illegal and strictly prohibited. If you are not the intended recipient, please notify the sender by replying to this message and delete all copies of it from your system. Thank you for cooperation.