From patchwork Tue Jun 14 08:46:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 12880712 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 71B63CCA47A for ; Tue, 14 Jun 2022 08:46:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241032AbiFNIqk (ORCPT ); Tue, 14 Jun 2022 04:46:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355873AbiFNIqZ (ORCPT ); Tue, 14 Jun 2022 04:46:25 -0400 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2786434B2 for ; Tue, 14 Jun 2022 01:46:20 -0700 (PDT) Received: by mail-lf1-x12b.google.com with SMTP id 20so12779207lfz.8 for ; Tue, 14 Jun 2022 01:46:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cmCUkZyYqf+fSr+qmDna92LF/wD5Dj/Ah1fbqp/t9Fc=; b=Lhk2HAruK6blf2W2bSttgu1d3q5FpOqeHtDxEokN5BstejeSqf7oKTZJqKzbbEhyce YMleKqWyPKI0c2R9KA2xZc6Br0LmeyolK1HHT2x2roKGKKLBx1R0Idq/Eq+60YZ6uPSM v+/ciSTtW7Tyb18KJq3p0Mx3YpseXHWSDPyxo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cmCUkZyYqf+fSr+qmDna92LF/wD5Dj/Ah1fbqp/t9Fc=; b=OLXMJaNaFSKcl+YlNBlzj1zH4mWqfDtGy1OSpfhm5OSkfdDA23+p/nL5/ulpoOPfYn HAJV5olz+S1upcKq8xNO0M/AYiHnrghS6MiOQrxLRWJMPSdpZEMPZHqULA7qILG2xiOs 52wlTs76048ZK73/BHtvPcq5QOGv5/5I8w9l9K1KAWYqVcS0Fw1vmLWDdxkCLYTIW2YL VA48pefY/TXUTTtppWPt7qHc0h/tE5EhJ0ci9M7C44NI91/NEFCQyQZrHYHNuGjlV4sD V5pRSzQOhTgpMjA5kQLukiHWy687lADTXmcAl/9/sD9R+e6gOjkK687O9lF3MTgO5Fom jLVg== X-Gm-Message-State: AOAM532BEUuHuCXtHAlvjXeVgKEFX8fooPlxpghSGVFN+Y75VYMMoQ7v uxmt40NN2hE2s6x/b5oJfDHO/NPYFlhon7Mn X-Google-Smtp-Source: AGRyM1tnVrDoaAyRb7zBWF5L0aoS5WCry23V8yDCUItYQSOXYDQhQDayc83GCERdmZO4XMcgqES6Rw== X-Received: by 2002:a05:6512:31c5:b0:479:47a1:2024 with SMTP id j5-20020a05651231c500b0047947a12024mr2407749lfe.420.1655196378944; Tue, 14 Jun 2022 01:46:18 -0700 (PDT) Received: from prevas-ravi.prevas.se ([81.216.59.226]) by smtp.gmail.com with ESMTPSA id g1-20020ac24d81000000b0047255d2118fsm1306116lfe.190.2022.06.14.01.46.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jun 2022 01:46:18 -0700 (PDT) From: Rasmus Villemoes To: netdev@vger.kernel.org, Andrew Lunn , Heiner Kallweit , Russell King Cc: devicetree@vger.kernel.org, Rob Herring , Jakub Kicinski , "David S. Miller" , Grygorii Strashko , Praneeth Bajjuri , linux-kernel@vger.kernel.org, Rasmus Villemoes Subject: [PATCH net-next v2 2/3] linux/phy.h: add phydev_err_probe() wrapper for dev_err_probe() Date: Tue, 14 Jun 2022 10:46:11 +0200 Message-Id: <20220614084612.325229-3-linux@rasmusvillemoes.dk> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220614084612.325229-1-linux@rasmusvillemoes.dk> References: <20220606202220.1670714-1-linux@rasmusvillemoes.dk> <20220614084612.325229-1-linux@rasmusvillemoes.dk> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org The dev_err_probe() function is quite useful to avoid boilerplate related to -EPROBE_DEFER handling. Add a phydev_err_probe() helper to simplify making use of that from phy drivers which otherwise use the phydev_* helpers. Signed-off-by: Rasmus Villemoes --- include/linux/phy.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/phy.h b/include/linux/phy.h index 508f1149665b..bed9a347481b 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h @@ -1539,6 +1539,9 @@ static inline void phy_device_reset(struct phy_device *phydev, int value) #define phydev_err(_phydev, format, args...) \ dev_err(&_phydev->mdio.dev, format, ##args) +#define phydev_err_probe(_phydev, err, format, args...) \ + dev_err_probe(&_phydev->mdio.dev, err, format, ##args) + #define phydev_info(_phydev, format, args...) \ dev_info(&_phydev->mdio.dev, format, ##args)