From patchwork Sun Jun 4 11:11:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 102978 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2090975vqr; Sun, 4 Jun 2023 04:33:39 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6GCg0cuXCRRv9dz/DQn7aOd6/2OMyzo/9DQuXam6ReUb/YfoNf7GmGGF1BjvfSD/rEGb1/ X-Received: by 2002:a9d:7d99:0:b0:6af:7e2c:f155 with SMTP id j25-20020a9d7d99000000b006af7e2cf155mr7304948otn.29.1685878418827; Sun, 04 Jun 2023 04:33:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685878418; cv=none; d=google.com; s=arc-20160816; b=J6qwDtC4zgw6Mh/hG2lkZpS2fUWUUtBiYEhMIQuqcyH2G2JcEfl1sfVSOJbcVZT1s8 rWjbKn+Bc2z8XuqzlwKk8+T2pOW5ImvIrZccg6/6oliS/0rOvdxxEsOu2mNOUH181864 FDlFllVBsO6kjywlKJOC59eIq8t+x4qi+JvvEF/pTmRa36YAhEOvxDLEE7NX5FFaRgKr lIgcRDrb9BJqZmKm28FbyXqb7/RCqi2RPcSUkkbx8kFzeFGtCV/xYLgUNrgbnOETGvXE SOCu/MIGCmZm8X+OmtLKWyMni1/W357yJOaslUXk08fZodSl8mFX4Kr7DnqW7ToEMWNw 9dlA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=UutA+4HoQTrFvBUHKvF3cps73mebreJXZd7+xMeN1VI=; b=T7/ZI2y301rRlvBuX1T4THUo28FLFI4ki4IC9K6ynrNyNWuQJ5R8T0h+2O3SnwAiL8 0pRvf02y1vc11sOIavivphD4mGZujRj+Se3U9qcVJfHcFMdG4nZjqlFjZh9qRxeSlLxy S4LbnNvJvdFVmJE+JcGPf1/0FL3msIudlhUt0tT5pvgSDSVQxcCeZfryqGdOU4Q02PQ7 ZApzW+WW9erM2u7Fvom63ouoCgc52YotvhJ3oXJdUc7pAyAl40CVgUwKsUKCfWR3Q68T rbcLUgLw3oQ67a+Occ5qhlOl913QK0YgXTHgli37qcE63HCXoxLlt6ZNVJFYtG1NRf+L Dw9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=UsygrdGW; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t8-20020a1709027fc800b001a197aa18fesi3880748plb.121.2023.06.04.04.33.23; Sun, 04 Jun 2023 04:33:38 -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=@wanadoo.fr header.s=t20230301 header.b=UsygrdGW; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231282AbjFDLLa (ORCPT + 99 others); Sun, 4 Jun 2023 07:11:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229749AbjFDLL2 (ORCPT ); Sun, 4 Jun 2023 07:11:28 -0400 Received: from smtp.smtpout.orange.fr (smtp-19.smtpout.orange.fr [80.12.242.19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 084F483 for ; Sun, 4 Jun 2023 04:11:26 -0700 (PDT) Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id 5ldsqSy1Rxbtx5ldsqUd84; Sun, 04 Jun 2023 13:11:25 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1685877085; bh=UutA+4HoQTrFvBUHKvF3cps73mebreJXZd7+xMeN1VI=; h=From:To:Cc:Subject:Date; b=UsygrdGW7TEBua2m9lk+P1GEARd5eoHSENJLiRV7uHBr/96ImlKJnfFampPX9oA8i 9BqlrZmF/G6WbxRg6mVW6ys29WSBPsvOHYj+xDOJNoeboRk97thIDWLKbFUcSiytfU mKDdOe4/AiH/H1HIr0vD4pez4GUJ49X4boTQDQm9IgBTkKGuvER/Mc1SXlc/ykUs14 YVTmxnD0mB4pR6hntAKl09H5XBdYGKH0NOMORkUDG0wNovDJft+8h2NCVEJHucy1WM KcoeBu/uBhJokHg0eAUb5nMmjt1q2y1R+/Sn1xqbXK/4yZu3yqxEajXyZnk7K4d1Kz XWkTCFBz+8Whg== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 04 Jun 2023 13:11:25 +0200 X-ME-IP: 86.243.2.178 From: Christophe JAILLET To: Richard Leitner , Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-usb@vger.kernel.org Subject: [PATCH] usb: usb251xb: Use of_property_read_u16() Date: Sun, 4 Jun 2023 13:11:18 +0200 Message-Id: <97478908a814d4fa694e0ca44212c3776cf3e6e9.1685877052.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE 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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767771648847348851?= X-GMAIL-MSGID: =?utf-8?q?1767771648847348851?= Use of_property_read_u16() instead of of_property_read_u16_array() when only 1 element is read. This slightly simplifies the code. Signed-off-by: Christophe JAILLET --- drivers/usb/misc/usb251xb.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/usb/misc/usb251xb.c b/drivers/usb/misc/usb251xb.c index 1f3329ef5c7a..e4edb486b69e 100644 --- a/drivers/usb/misc/usb251xb.c +++ b/drivers/usb/misc/usb251xb.c @@ -416,14 +416,13 @@ static int usb251xb_get_ofdata(struct usb251xb *hub, return dev_err_probe(dev, PTR_ERR(hub->gpio_reset), "unable to request GPIO reset pin\n"); - if (of_property_read_u16_array(np, "vendor-id", &hub->vendor_id, 1)) + if (of_property_read_u16(np, "vendor-id", &hub->vendor_id)) hub->vendor_id = USB251XB_DEF_VENDOR_ID; - if (of_property_read_u16_array(np, "product-id", - &hub->product_id, 1)) + if (of_property_read_u16(np, "product-id", &hub->product_id)) hub->product_id = data->product_id; - if (of_property_read_u16_array(np, "device-id", &hub->device_id, 1)) + if (of_property_read_u16(np, "device-id", &hub->device_id)) hub->device_id = USB251XB_DEF_DEVICE_ID; hub->conf_data1 = USB251XB_DEF_CONFIG_DATA_1; @@ -532,7 +531,7 @@ static int usb251xb_get_ofdata(struct usb251xb *hub, if (!of_property_read_u32(np, "power-on-time-ms", &property_u32)) hub->power_on_time = min_t(u8, property_u32 / 2, 255); - if (of_property_read_u16_array(np, "language-id", &hub->lang_id, 1)) + if (of_property_read_u16(np, "language-id", &hub->lang_id)) hub->lang_id = USB251XB_DEF_LANGUAGE_ID; if (of_property_read_u8(np, "boost-up", &hub->boost_up))