From patchwork Wed Oct 19 13:33:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Winkler, Tomas" X-Patchwork-Id: 9384585 X-Patchwork-Delegate: sameo@linux.intel.com 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 6C3C660762 for ; Wed, 19 Oct 2016 15:42:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5FA1F27EED for ; Wed, 19 Oct 2016 15:42:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 549A628C65; Wed, 19 Oct 2016 15:42:32 +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=unavailable 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 2A11927EED for ; Wed, 19 Oct 2016 15:42:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S945453AbcJSPmC (ORCPT ); Wed, 19 Oct 2016 11:42:02 -0400 Received: from mga03.intel.com ([134.134.136.65]:55827 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S943473AbcJSPA4 (ORCPT ); Wed, 19 Oct 2016 11:00:56 -0400 Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga103.jf.intel.com with ESMTP; 19 Oct 2016 06:35:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,514,1473145200"; d="scan'208";a="21298753" Received: from twinkler-lnx.jer.intel.com ([10.12.87.167]) by fmsmga005.fm.intel.com with ESMTP; 19 Oct 2016 06:35:42 -0700 From: Tomas Winkler To: Greg Kroah-Hartman , Aloisio Almeida Jr , Samuel Ortiz , Wim Van Sebroeck , Guenter Roeck Cc: Alexander Usyskin , linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, linux-watchdog@vger.kernel.org, Tomas Winkler Subject: [char-misc-next 4/5] nfc: mei_phy: get phy from the driver data Date: Wed, 19 Oct 2016 16:33:30 +0300 Message-Id: <1476884011-20645-5-git-send-email-tomas.winkler@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1476884011-20645-1-git-send-email-tomas.winkler@intel.com> References: <1476884011-20645-1-git-send-email-tomas.winkler@intel.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In order to remove rather redundant context from the callback signature we the get nfc mei_phy from the driver's data. Signed-off-by: Tomas Winkler --- drivers/nfc/mei_phy.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/nfc/mei_phy.c b/drivers/nfc/mei_phy.c index 83deda4bb4d6..66dfd81ffb18 100644 --- a/drivers/nfc/mei_phy.c +++ b/drivers/nfc/mei_phy.c @@ -300,7 +300,10 @@ static int mei_nfc_recv(struct nfc_mei_phy *phy, u8 *buf, size_t length) static void nfc_mei_event_cb(struct mei_cl_device *cldev, u32 events, void *context) { - struct nfc_mei_phy *phy = context; + struct nfc_mei_phy *phy = mei_cldev_get_drvdata(cldev); + + if (!phy) + return; if (phy->hard_fault != 0) return;