Received: by 10.213.65.68 with SMTP id h4csp1630336imn; Mon, 19 Mar 2018 09:10:31 -0700 (PDT) X-Google-Smtp-Source: AG47ELuUiYS2TVmv3vEw5qNGjtuPvRpTA8Ygjrmzz4qHw1Or7jLiBBEgzjuLq2ME0oyLKVrgFFMc X-Received: by 10.99.117.68 with SMTP id f4mr9725579pgn.437.1521475831133; Mon, 19 Mar 2018 09:10:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521475831; cv=none; d=google.com; s=arc-20160816; b=MrIQOF9Z51XLi/AShZedmJ+kYc5Gpngd8t3uNyNv569447EOoWy36w8qnq2ES64Aax EDKifLYOks60F7NzgfaoreoIfvja6SRf44vOT1sO8V4GaeZYoVq3GjxMMHEP4pOFEYy7 Epsxg7FQOMhF3umNZS2BZqNheeu7OhvkU0mV7JLmFWLrYIl7CbJt66LKkGgMnkYwf7sM ewCuKoZ9dFNDd36jrvwcYyqnYHqqUeMatCwGbKUxqdcChauf2mYz9G+D0Cc6P6FLUvPQ uLLUbzSXdXL37ydq6BPp2QZ5BDwpUkb05Nmsij/Do7fIMrB5Nt6dfBc6SAPfgEJ5q8QH 2E4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=aFgOkmqua8OgPFlgk5DuUkOmrHjrA/HnluhotHo0HFM=; b=09RXe6ecQGMzYfkzNFFyq+OUlMjU60FdOZut+USsZ9bXoQaJA8hKRbTTratgmhAlkA PeNjMgCr5RUmeNIc47kpZ6RaBQoit+k8koR8cSQYec34w+ojw6vnzZUYrOc/EJa2QQO6 ue5SYMcK5Py2aWCJIecOdAjWW9jNfoJEkkBAjGPOcqX9Uw4CrKjQ4lQQPP2vY3rAyw9g PDll1h1Jm6wU3OSppK2s5rubKj3r9hq4QJwyB/KCGr74dsAABz87obflYFA6KdnRW9X6 bIo1lumHSP1Y91zo9SlVjet6/G9be7fn9or24OEpEQ8cxusb0yip7cejP5/g9e98Nayg bzzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=gFlipvCQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h12-v6si150395pls.86.2018.03.19.09.10.16; Mon, 19 Mar 2018 09:10:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=gFlipvCQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966172AbeCSQHc (ORCPT + 99 others); Mon, 19 Mar 2018 12:07:32 -0400 Received: from mail-cys01nam02on0100.outbound.protection.outlook.com ([104.47.37.100]:20505 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S966064AbeCSQHA (ORCPT ); Mon, 19 Mar 2018 12:07:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=aFgOkmqua8OgPFlgk5DuUkOmrHjrA/HnluhotHo0HFM=; b=gFlipvCQb7FGTM0QYCADJfqJs5mVZxBg1nx78QLOEUBQ2Yps8uiC1GAgBwa5RWV/9epUP85ReV1sCDA++JxXwcMzxDJ/ac/9Z5DCCDcMyv3B9w1oDFzHytGEKYM41bYOUF9PAjv5Zt+ZHP4CX84zIgBbJb95W3FXvZyM/u7H544= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1093.namprd21.prod.outlook.com (52.132.130.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.631.0; Mon, 19 Mar 2018 16:06:52 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::3d9b:79e7:94eb:5d62]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::3d9b:79e7:94eb:5d62%5]) with mapi id 15.20.0631.004; Mon, 19 Mar 2018 16:06:52 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Dmitry Torokhov , Sasha Levin Subject: [PATCH AUTOSEL for 4.4 024/167] Input: elan_i2c - check if device is there before really probing Thread-Topic: [PATCH AUTOSEL for 4.4 024/167] Input: elan_i2c - check if device is there before really probing Thread-Index: AQHTv5wmd4xxesW2mUu6M1lp8DkkUQ== Date: Mon, 19 Mar 2018 16:05:51 +0000 Message-ID: <20180319160513.16384-24-alexander.levin@microsoft.com> References: <20180319160513.16384-1-alexander.levin@microsoft.com> In-Reply-To: <20180319160513.16384-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB1093;7:LBKnHHdjwb2kp9GJBChhziyLQMBfIxaaGzogfPHPp7rgd2yRl4rkrQfxWHFin954qkkJVK+6m0FB8QXlkCXxYLvqqVeqtPVnNShAIxvOs4ziFnEPF+GuP4aifikpHW7z6/+h91Jw1cHX1hS85sqyue50/RdeM+bhZfT/sytyOGrO1/NToKlBzOKepW3Cz48EW0eyJjCfSOGgq1AN8nzSgZvuXhdM5qTX2Rj6vTUBX3d1BmfTd5xKcqGTbegma7NN;20:rcgkvFEF+Mvu1iTfMUm0XbrTtSaHsSXzJSTrkAU7tK6G93kekI0BIRzydKOMPli9YADZWqaQujKb9QszA3xZWOTAf3nA1KaIkw4OVlerQmfX+UYfgS0XWLyBhZa3th80+H6lIWzC/4XvA/GBJkAwzi1A/W/N9LonjnD5GK164qY= x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: ae62d326-5180-4f49-663f-08d58db36dea x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB1093; x-ms-traffictypediagnostic: DM5PR2101MB1093: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(85827821059158); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(5005006)(8121501046)(3231221)(944501300)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(61426038)(61427038)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(20161123558120)(6072148)(201708071742011);SRVR:DM5PR2101MB1093;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB1093; x-forefront-prvs: 06167FAD59 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(376002)(396003)(39380400002)(366004)(39860400002)(346002)(189003)(199004)(10290500003)(68736007)(478600001)(110136005)(72206003)(36756003)(99286004)(97736004)(10090500001)(305945005)(7736002)(76176011)(107886003)(2950100002)(39060400002)(6436002)(86612001)(6486002)(4326008)(54906003)(186003)(3660700001)(25786009)(26005)(2906002)(53936002)(5250100002)(2501003)(81166006)(81156014)(2900100001)(86362001)(5660300001)(8936002)(1076002)(8676002)(3846002)(3280700002)(6116002)(66066001)(316002)(6506007)(14454004)(106356001)(6512007)(22452003)(105586002)(102836004)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB1093;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 3Yu2iu1cEuakYHRhu8fYxSnD8l0dW5CWW5IS8z9ZDWTkHS9QpOOWSeuDoebaWF6XJa6fpsgN9Aucd1Cd+K2sfRYVzZbTTX+FLMmwiNYfggUMJovn/4r3uvrt7kzmyofvVmHzZxzV/h6+tRw4feEK+QnaHj2oInJQrB+nQdsIAT+liLyuAXuihmCYJtM0qb/TvGEIS9i5d380Ob8zBKbArE9z583Ak8IT3XQYsc9RNbWjVc/xhZFVWLRIMxovcy48FUp79BNLCNFwlFLXIap/M/E69WsMsmCdUuDtjIrGK8gspNrxnKb/r4jy0wyS2YQxYs4YrtLzJ9K93xvF+YLIXw== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: ae62d326-5180-4f49-663f-08d58db36dea X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Mar 2018 16:05:51.0517 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1093 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dmitry Torokhov [ Upstream commit c5928551fd41b2eecdad78fa2be2a4a13ed5fde9 ] Before trying to properly initialize the touchpad and generate bunch of errors, let's first see it there is anything at the given address. If we get error, fail silently with -ENXIO. Reviewed-by: Guenter Roeck Signed-off-by: Dmitry Torokhov Signed-off-by: Sasha Levin --- drivers/input/mouse/elan_i2c_core.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan= _i2c_core.c index c9d491bc85e0..3851d5715772 100644 --- a/drivers/input/mouse/elan_i2c_core.c +++ b/drivers/input/mouse/elan_i2c_core.c @@ -1082,6 +1082,13 @@ static int elan_probe(struct i2c_client *client, return error; } =20 + /* Make sure there is something at this address */ + error =3D i2c_smbus_read_byte(client); + if (error < 0) { + dev_dbg(&client->dev, "nothing at this address: %d\n", error); + return -ENXIO; + } + /* Initialize the touchpad. */ error =3D elan_initialize(data); if (error) --=20 2.14.1