Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp3428385rwi; Tue, 1 Nov 2022 21:31:40 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6YD06FdBiL8JPGjfgEkHsAkMMfp7DPQ8Y4jjgELpAOHzynNQFQr5Tcd+W+/xCjmy7quYrN X-Received: by 2002:a17:906:9bd5:b0:7ad:939d:79a9 with SMTP id de21-20020a1709069bd500b007ad939d79a9mr21253091ejc.479.1667363499970; Tue, 01 Nov 2022 21:31:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667363499; cv=none; d=google.com; s=arc-20160816; b=MONZ4gJdJJtk7VGRgeyxPPC7CX40GUofR82E5LfgCgkDKEtJxwgbetvWwBwI3BSait zRIVk7sUcnQpKeZxfFdMJ2JPHfXBx3bsVUG538UYmlr2m3+hQIsznRURiOjK/W4+I0Sl C6vobwX89sAX9xxWJ3BQC9PwAylztryfrTRKu7RkFSN5olnwQHiVGVnbG/dF3RFSl0qj tF9kYX82NU1VFRbT6T0gbG5LqAAK2jFpxXd1Z1tyFEwQwSrNIUds1jztUEa6DjcpUQDp MRiqjrF4F3boROzbVq6SY9e/51whGqPkIDJ7ZALwpvvm7a+O7Jfg9fJbJ6Csem9+NLDn FTbw== 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=SxHiO70i9PsvluYl8QEPfvHjq+Kxe7Zx7Z8JewlmLQw=; b=SuX0s4qcsWa+9cnxXe5tmti5DeCSb/2bx1LaHRTIFwbCJWda1NGIqz2ycWZWJtNWG8 nBZ+pW6kw3HUpdoZ8XViPZpHR2hufTc0fcVxIOS2XGV56QLuJ89LtKqm637e528mjIlH lvRqfDHp2itlbIsOKEnbZgh3cgYnhxOY7Sq0WssNNWgeh2ROzcBoPflMOtUQtyoAPrAc RG0OtAN6j0aUS7fsdje5HlTSUQHYbkIykP1aM4zVHnRJFf916AkMm+pTiQVXmEcYscNT dOjE694nJrI96cDEeXdJO3qMcdGeyCEluce9iQA588OMXfdJu8oJLtuv8vPpEEDYbX3Y oXcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=uoGbcuOL; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y8-20020a50eb08000000b00461a976f952si12116473edp.543.2022.11.01.21.31.15; Tue, 01 Nov 2022 21:31:39 -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=@microchip.com header.s=mchp header.b=uoGbcuOL; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230259AbiKBEPh (ORCPT + 96 others); Wed, 2 Nov 2022 00:15:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52188 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229906AbiKBEPO (ORCPT ); Wed, 2 Nov 2022 00:15:14 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9939623BEA; Tue, 1 Nov 2022 21:14:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1667362483; x=1698898483; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=sZkHzp4axHvnVQJ1e6P/AN6YKQRNToLw1Xi9YPFU8ms=; b=uoGbcuOLEJuYwbY/ZM2qWX+xr++iXDH5VgvFzHU2rkogwzrlRbUiJjJD zcGYII5lPKp/Lst2j7GrWopCxfYKKXX70oy7cLp4640N6DODtFH167cT1 hLH8IRJNYxs4xYDBJXQGNZ9lEtQigVs4rTAqIQEGME0vI6sBY2hHrXZRw RkxEnD4oRihaRF+iUCa8J5XEgM0mIf2QkUKB1EuGss2X8g6VY3ThOgln5 B9Hp5mMFugeDRot74L/0wYKQg67SuqMpjj+ooFDnCxY/sngTVH8pZdDxT T8GEEkeT3TvAq9/F+8+N+eD13JDPpf43C4UR6Uy3Y6ooshphwR9sXEuHq w==; X-IronPort-AV: E=Sophos;i="5.95,232,1661842800"; d="scan'208";a="184948864" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 01 Nov 2022 21:14:42 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.12; Tue, 1 Nov 2022 21:14:40 -0700 Received: from che-lt-i67786lx.microchip.com (10.10.115.15) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2507.12 via Frontend Transport; Tue, 1 Nov 2022 21:14:36 -0700 From: Rakesh Sankaranarayanan To: , CC: , , , , , , , , , Subject: [PATCH net-next 4/6] net: dsa: microchip: add error checking for ksz_pwrite Date: Wed, 2 Nov 2022 09:40:56 +0530 Message-ID: <20221102041058.128779-5-rakesh.sankaranarayanan@microchip.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221102041058.128779-1-rakesh.sankaranarayanan@microchip.com> References: <20221102041058.128779-1-rakesh.sankaranarayanan@microchip.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS 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 Add status validation for port register write inside lan937x_change_mtu. ksz_pwrite and ksz_pread api's are updated with return type int (Reference patch mentioned below). Update lan937x_change_mtu with status validation for ksz_pwrite16(). Link: https://patchwork.kernel.org/project/netdevbpf/patch/20220826105634.3855578-6-o.rempel@pengutronix.de/ Signed-off-by: Rakesh Sankaranarayanan --- drivers/net/dsa/microchip/lan937x_main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/dsa/microchip/lan937x_main.c b/drivers/net/dsa/microchip/lan937x_main.c index 7e4f307a0387..06d3d0308cba 100644 --- a/drivers/net/dsa/microchip/lan937x_main.c +++ b/drivers/net/dsa/microchip/lan937x_main.c @@ -242,7 +242,11 @@ int lan937x_change_mtu(struct ksz_device *dev, int port, int new_mtu) } /* Write the frame size in PORT_MAX_FR_SIZE register */ - ksz_pwrite16(dev, port, PORT_MAX_FR_SIZE, new_mtu); + ret = ksz_pwrite16(dev, port, PORT_MAX_FR_SIZE, new_mtu); + if (ret) { + dev_err(ds->dev, "failed to update mtu for port %d\n", port); + return ret; + } return 0; } -- 2.34.1