From patchwork Wed Mar 27 16:43:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heikki Krogerus X-Patchwork-Id: 10873761 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 8BC9117E0 for ; Wed, 27 Mar 2019 16:44:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 773BF28A32 for ; Wed, 27 Mar 2019 16:44:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6BB1928ACB; Wed, 27 Mar 2019 16:44:01 +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 0A18C28A49 for ; Wed, 27 Mar 2019 16:44:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728627AbfC0Qnx (ORCPT ); Wed, 27 Mar 2019 12:43:53 -0400 Received: from mga12.intel.com ([192.55.52.136]:62434 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726740AbfC0Qnw (ORCPT ); Wed, 27 Mar 2019 12:43:52 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Mar 2019 09:43:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,277,1549958400"; d="scan'208";a="158912750" Received: from black.fi.intel.com (HELO black.fi.intel.com.) ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 27 Mar 2019 09:43:48 -0700 From: Heikki Krogerus To: "Rafael J. Wysocki" Cc: Greg Kroah-Hartman , Andy Shevchenko , Chunfeng Yun , Biju Das , Hans de Goede , linux-acpi@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/3] usb: typec: mux: Use the "compatible" property instead of a boolean property Date: Wed, 27 Mar 2019 19:43:39 +0300 Message-Id: <20190327164339.31205-4-heikki.krogerus@linux.intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190327164339.31205-1-heikki.krogerus@linux.intel.com> References: <20190327164339.31205-1-heikki.krogerus@linux.intel.com> MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Instead of searching for a boolean property, matching against the "compatible" property. Signed-off-by: Heikki Krogerus --- drivers/usb/typec/mux.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/usb/typec/mux.c b/drivers/usb/typec/mux.c index 2ce54f3fc79c..9462b90f1c09 100644 --- a/drivers/usb/typec/mux.c +++ b/drivers/usb/typec/mux.c @@ -32,11 +32,7 @@ static void *typec_switch_match(struct device_connection *con, int ep, return ERR_PTR(-EPROBE_DEFER); } - /* - * With OF graph the mux node must have a boolean device property named - * "orientation-switch". - */ - if (con->id && !fwnode_property_present(con->fwnode, con->id)) + if (con->id && !fwnode_is_compatible(con->fwnode, con->id)) return NULL; list_for_each_entry(sw, &switch_list, entry) @@ -148,7 +144,7 @@ static void *typec_mux_match(struct device_connection *con, int ep, void *data) /* Accessory Mode muxes */ if (!desc) { - match = fwnode_property_present(con->fwnode, "accessory"); + match = fwnode_is_compatible(con->fwnode, "accessory"); if (match) goto find_mux; return NULL;