From patchwork Tue Aug 8 16:27:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 132679 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp2310562vqr; Tue, 8 Aug 2023 11:20:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE5NHLWZcsGVc+fUIezYUWdtcdK7yEmnVwmsPu+z4TB0gHQqou8Mz0WmCfyqCLazLPdd53u X-Received: by 2002:a05:6830:1d46:b0:6bd:b10:c321 with SMTP id p6-20020a0568301d4600b006bd0b10c321mr413072oth.10.1691518832654; Tue, 08 Aug 2023 11:20:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691518832; cv=none; d=google.com; s=arc-20160816; b=tSuUrpU/D7yJgAYD47dp3t8vzNViGwyvPCkn2Ay2epTKEPmu/qK6dW8XI0JUTd9ajA 6ImKwWzth3VQ33wn9kWaRfUvkTMSIYANHILa/CEOBUY3fJHBkzP1hN+AxtaT6o99TCvy 4W+ZYQZ81gqVOv1OTE6qLnsGv1SvvhOHMRpkbbGk51haih4F7ssjIrCaVFZyZx1kA936 01bu8c4rphujVbw5gYe8rwW6zbDIMV4PRw9ppqHfygtCpnX9Uqus1fk1xSkLiqUFISXv B0vsyERJ5FGoAhj1nrtIBgsH+7U31ti8m5/3WJcXJep0VvaisFQLxRMleeN7Ei/UyhMX r9xA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=xPhhxCR3AC+PWGyTZX9k6ouQ+XK7LZI8BG4GPahMZHw=; fh=pEdA8+/af95LJlWFD5rBB7RG10kRMWALDQ/52TY9s20=; b=sxo7UOpjmtuWdWHZaf0nNTEGwswFFDVe5JWT4a7dbJUI1BSzy+kwlIbR3U0XN2K3IX e/3h+4jxEQDLl8tUJZFGc64YQEa3vKaJAJdX51fVKDiC+hfY35dNgwNEfP3FQOdx87EA 8/SNfYl7q8kr/Jbr7BQAk91APs1rEi1GhSTXq0sEQf14raaWnvlxVHbNdljh1UwZIL3P /jvW4nF3ant3O+C9DUSsAyVXXhDk9RxG22OrUmTUw2t9KtRGtRn/7zzqQJh3xrDrovlB yqWKQdgXLtVGm+K2q/md0ETTOFxJin/PnJju7PrUYxY4gMUdVFihwlraEWoulfljABnv Zqvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=B0MUE1ww; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g30-20020a63201e000000b00560132689ccsi7542534pgg.349.2023.08.08.11.20.19; Tue, 08 Aug 2023 11:20:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=B0MUE1ww; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235208AbjHHSAI (ORCPT + 99 others); Tue, 8 Aug 2023 14:00:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231880AbjHHR7g (ORCPT ); Tue, 8 Aug 2023 13:59:36 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4DB77890C; Tue, 8 Aug 2023 09:27:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1691512033; x=1723048033; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=2+l/cxo6AVrTQ5h7fePgIjT5ulStNYcn0rdQ6zjsI/Q=; b=B0MUE1wwxVQFPdY227NubGwER82koUIKSCX14p7R1ascwHPWAjzsAKWG Xdep4Np8VdpAAn+AEgEqtKNM4FvQMcMYsn+GV1NZ6dfTq9JkxfyEWqku9 ym6Mhsl8kFuvf/OotJfk8GghBjtdLeEZEUL85LgVuACHbrth5JZQgmN9T OsPB6S/EnNcg97ez15USVP0QHoVpJghG5DXcv28itUnutGO+wW3py9NIu jGwXsgB5+UIFphiR/opG0YrHtfjVH6wBQH2ClPT1++8lDOt5Q5JG7Eqod i+St1iXmKPp69EbyXHmf+/97GyXpiXLiWKb2DV27tnQ+lrE/la4gLLwfC w==; X-IronPort-AV: E=McAfee;i="6600,9927,10795"; a="457261002" X-IronPort-AV: E=Sophos;i="6.01,156,1684825200"; d="scan'208";a="457261002" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Aug 2023 09:25:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10795"; a="821449261" X-IronPort-AV: E=Sophos;i="6.01,156,1684825200"; d="scan'208";a="821449261" Received: from black.fi.intel.com ([10.237.72.28]) by FMSMGA003.fm.intel.com with ESMTP; 08 Aug 2023 09:24:59 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 6A2811358; Tue, 8 Aug 2023 19:28:03 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Greg Kroah-Hartman , Antoniu Miclaus , Jonathan Cameron , Gerald Loacker , Gwendal Grignou , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org Cc: Daniel Scally , Heikki Krogerus , Sakari Ailus , "Rafael J. Wysocki" , Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron Subject: [PATCH v1 5/6] iio: magnetometer: tmag5273: Switch to device_property_match_property_string() Date: Tue, 8 Aug 2023 19:27:59 +0300 Message-Id: <20230808162800.61651-6-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b In-Reply-To: <20230808162800.61651-1-andriy.shevchenko@linux.intel.com> References: <20230808162800.61651-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773686051011817983 X-GMAIL-MSGID: 1773686051011817983 Replace open coded device_property_match_property_string(). Signed-off-by: Andy Shevchenko --- drivers/iio/magnetometer/tmag5273.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/iio/magnetometer/tmag5273.c b/drivers/iio/magnetometer/tmag5273.c index c5e5c4ad681e..bcd989d65059 100644 --- a/drivers/iio/magnetometer/tmag5273.c +++ b/drivers/iio/magnetometer/tmag5273.c @@ -497,17 +497,13 @@ static int tmag5273_set_operating_mode(struct tmag5273_data *data, static void tmag5273_read_device_property(struct tmag5273_data *data) { struct device *dev = data->dev; - const char *str; int ret; data->angle_measurement = TMAG5273_ANGLE_EN_X_Y; - ret = device_property_read_string(dev, "ti,angle-measurement", &str); - if (ret) - return; - - ret = match_string(tmag5273_angle_names, - ARRAY_SIZE(tmag5273_angle_names), str); + ret = device_property_match_property_string(dev, "ti,angle-measurement", + tmag5273_angle_names, + ARRAY_SIZE(tmag5273_angle_names)); if (ret >= 0) data->angle_measurement = ret; }