From patchwork Fri Jan 19 14:35:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 10175455 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 37C0960392 for ; Fri, 19 Jan 2018 14:35:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2FE9128696 for ; Fri, 19 Jan 2018 14:35:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 22775286A7; Fri, 19 Jan 2018 14:35:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AEAFE28696 for ; Fri, 19 Jan 2018 14:35:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755008AbeASOfI (ORCPT ); Fri, 19 Jan 2018 09:35:08 -0500 Received: from mga09.intel.com ([134.134.136.24]:7434 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754809AbeASOfH (ORCPT ); Fri, 19 Jan 2018 09:35:07 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Jan 2018 06:35:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,381,1511856000"; d="scan'208";a="27820452" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga002.jf.intel.com with ESMTP; 19 Jan 2018 06:35:05 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id C8247C5; Fri, 19 Jan 2018 16:35:04 +0200 (EET) From: Andy Shevchenko To: Jiri Kosina , Benjamin Tissoires , linux-input@vger.kernel.org Cc: Andy Shevchenko Subject: [PATCH v1] i2c-hid: Use ACPI_COMPANION() directly Date: Fri, 19 Jan 2018 16:35:04 +0200 Message-Id: <20180119143504.16684-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.15.1 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Instead of doing additional checks and functional calls, just get ACPI companion device directly. Signed-off-by: Andy Shevchenko --- drivers/hid/i2c-hid/i2c-hid.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c index 7230243b94d3..0d3ca542e987 100644 --- a/drivers/hid/i2c-hid/i2c-hid.c +++ b/drivers/hid/i2c-hid/i2c-hid.c @@ -891,10 +891,10 @@ static int i2c_hid_acpi_pdata(struct i2c_client *client, static void i2c_hid_acpi_fix_up_power(struct device *dev) { - acpi_handle handle = ACPI_HANDLE(dev); struct acpi_device *adev; - if (handle && acpi_bus_get_device(handle, &adev) == 0) + adev = ACPI_COMPANION(dev); + if (adev) acpi_device_fix_up_power(adev); }