From patchwork Thu Mar 28 17:17:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 10875483 X-Patchwork-Delegate: rjw@sisk.pl Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0217213B5 for ; Thu, 28 Mar 2019 17:17:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D42D128B49 for ; Thu, 28 Mar 2019 17:17:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C885B28B4D; Thu, 28 Mar 2019 17:17:38 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 A47CF28BEB for ; Thu, 28 Mar 2019 17:17:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726332AbfC1RRg (ORCPT ); Thu, 28 Mar 2019 13:17:36 -0400 Received: from mga18.intel.com ([134.134.136.126]:13126 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726281AbfC1RRf (ORCPT ); Thu, 28 Mar 2019 13:17:35 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Mar 2019 10:17:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,281,1549958400"; d="scan'208";a="138206033" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga007.fm.intel.com with ESMTP; 28 Mar 2019 10:17:31 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 549D71A2; Thu, 28 Mar 2019 19:17:30 +0200 (EET) From: Andy Shevchenko To: "Rafael J. Wysocki" , linux-acpi@vger.kernel.org, Pierre-Louis Bossart , Liam Girdwood , Jie Yang , Mark Brown , alsa-devel@alsa-project.org, Hans de Goede , Mika Westerberg Cc: Andy Shevchenko , Chanwoo Choi , MyungJoo Ham , Chen-Yu Tsai Subject: [PATCH v3 02/10] extcon: axp288: Convert to use acpi_dev_get_first_match_dev() Date: Thu, 28 Mar 2019 19:17:21 +0200 Message-Id: <20190328171729.44002-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190328171729.44002-1-andriy.shevchenko@linux.intel.com> References: <20190328171729.44002-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP acpi_dev_get_first_match_name() is deprecated and going to be removed because it leaks a reference. Convert the driver to use acpi_dev_get_first_match_dev() instead. Cc: Chanwoo Choi Cc: MyungJoo Ham Cc: Chen-Yu Tsai Signed-off-by: Andy Shevchenko Acked-by: Chanwoo Choi --- drivers/extcon/extcon-axp288.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/extcon/extcon-axp288.c b/drivers/extcon/extcon-axp288.c index a983708b77a6..50f9402fb325 100644 --- a/drivers/extcon/extcon-axp288.c +++ b/drivers/extcon/extcon-axp288.c @@ -333,7 +333,7 @@ static int axp288_extcon_probe(struct platform_device *pdev) struct axp288_extcon_info *info; struct axp20x_dev *axp20x = dev_get_drvdata(pdev->dev.parent); struct device *dev = &pdev->dev; - const char *name; + struct acpi_device *adev; int ret, i, pirq; info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL); @@ -357,9 +357,10 @@ static int axp288_extcon_probe(struct platform_device *pdev) if (ret) return ret; - name = acpi_dev_get_first_match_name("INT3496", NULL, -1); - if (name) { - info->id_extcon = extcon_get_extcon_dev(name); + adev = acpi_dev_get_first_match_dev("INT3496", NULL, -1); + if (adev) { + info->id_extcon = extcon_get_extcon_dev(acpi_dev_name(adev)); + put_device(&adev->dev); if (!info->id_extcon) return -EPROBE_DEFER;