From nobody Thu Nov 28 11:39:34 2024 Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6FB891CB30F; Tue, 1 Oct 2024 18:46:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727808372; cv=none; b=sLXt1d8F8HCZ8+ug83GWBaWA3PBXS1wC783IyLZKM5+y/mJjUPE3KHwXC1fHhlMrkH93TBGCpvOPpfideUOOzjj8sxnky6x0AUFX85HjSOlsyxjhero2iOQbxhkrEGxa2RfvqQqQqfZVtKOSyFLbY2W385GEHKuvGL3Ns5PNrz4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727808372; c=relaxed/simple; bh=V+I48YD8Y10rzK6qdZiK+Aso9HG/1PeUAGmHS/rAJgU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Ek2ZvNy/RwS1tHGQSKWKrMSVrkyZOV8wPJMeoFrpQnYxeX/jYR1+YS185AeUnyBk8b2crL1iT3NGQkPgKxT+5AhlQM1jYqq6CevMMIun/OgYy+zunMEphj0xJlN3Y8YIR0ohgakKnMLhjcUNVXv5ybfKuUl5efX5oHDVYX81Orc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=TufMjhQp; arc=none smtp.client-ip=209.85.214.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="TufMjhQp" Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-20b8be13cb1so26386495ad.1; Tue, 01 Oct 2024 11:46:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727808370; x=1728413170; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=iUpXhS7ZVxil6l2rJnVVFZy6bfZdF72/d9g+8sUCIdI=; b=TufMjhQpJUt00ivcvlQnvJI4HB1rbIkyYbIrvvI7EGZMq6sDwJeMVQemufbjIOqYqL 0/y3LNYJyKIxNK7lrfziA4tvMdmHSRBHpyvYH5oXyGkGp3y1zTpLUaOxK3v5dcR2obxJ fcvQpHNZ8ZEEfvvfjHWBsXM/pmPL8ATYcnO0i+DbYdjO89Pc+GuSBXi4XdaY0MgLpz9+ oHlTudlY9tbOc605xj1czrRTrz62Ey1iJ5Z8dpLSyizvC3T5nf7K8t0RsRUkrcfESQ6S 7fyonaTD5Tu0al6kUQBsfj8RDM5O5WoqsqKeq/AcY/HWE//JIPahJhBtiDNOoPTwU8tC O3Cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727808370; x=1728413170; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iUpXhS7ZVxil6l2rJnVVFZy6bfZdF72/d9g+8sUCIdI=; b=v4a0xI7UdgzssJuFvqpZNUde0FTfYfAQODjESD9kSmVFjdUDXVzIxQWfC1XhMcPNlr HUXlKq/NO+iRQGwQefniepHRYy+cpPybMX7ty3Vps/wkBiSBOQjZQVgovabwfo/tq2E0 KFJavhsVn2lgtBF058giPi632kah3HbxKVQNwjowqUk/+29sG1Oi/l4aJwYdh9lQMffI evT83s6kpcISE7m0ul9gTrVgz3V3cVEIQuKgu+2ZpXx/A+/fi4hQRb9aPNZZq0Kh6CBN OQko7zJgAWKI4wx3GqXXQi8wDQuDpqNLJtNKFXHFYEsxb9mgNIAwQH0yAB/zBkfKQTGj RjSQ== X-Forwarded-Encrypted: i=1; AJvYcCUhNAsyT+pJypqhl+JHIA/mL2LrX9hI/vMFjGRTbOdMrODYanniaGQvQXEidFQDFT6XEMfJykexe6T798g=@vger.kernel.org X-Gm-Message-State: AOJu0Yw7NCyZRBvwYkqxT5TwK0C/kSfWZxp8nSIX+NFUDPY20OFrjJj9 446V4dKiFn7F1GjEd8wTNoKbPYiqASlv+KNnbPdEip7YTGAKKOje0r8CG37L X-Google-Smtp-Source: AGHT+IG10/ec+ECOJ2DNeRyPlVttS+UPhhzYEiNa8g/4Z6dp+cxUxS0IO0/Uh5MO018ZMI4Fvcl3wQ== X-Received: by 2002:a17:902:c946:b0:20b:5aff:dd50 with SMTP id d9443c01a7336-20bc5a1f1f8mr6790515ad.31.1727808370585; Tue, 01 Oct 2024 11:46:10 -0700 (PDT) Received: from ryzen.lan ([2601:644:8200:dab8::a86]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20b37e357absm72278965ad.190.2024.10.01.11.46.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Oct 2024 11:46:10 -0700 (PDT) From: Rosen Penev To: netdev@vger.kernel.org Cc: andrew@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux-kernel@vger.kernel.org, olek2@wp.pl, shannon.nelson@amd.com Subject: [PATCHv2 net-next 01/10] net: lantiq_etop: use netif_receive_skb_list Date: Tue, 1 Oct 2024 11:45:58 -0700 Message-ID: <20241001184607.193461-2-rosenp@gmail.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241001184607.193461-1-rosenp@gmail.com> References: <20241001184607.193461-1-rosenp@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Improves cache efficiency by batching rx skb processing. Small performance improvement on RX. Signed-off-by: Rosen Penev Reviewed-by: Shannon Nelson --- drivers/net/ethernet/lantiq_etop.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/lantiq_etop.c b/drivers/net/ethernet/lant= iq_etop.c index 3c289bfe0a09..94b37c12f3f7 100644 --- a/drivers/net/ethernet/lantiq_etop.c +++ b/drivers/net/ethernet/lantiq_etop.c @@ -122,8 +122,7 @@ ltq_etop_alloc_skb(struct ltq_etop_chan *ch) return 0; } =20 -static void -ltq_etop_hw_receive(struct ltq_etop_chan *ch) +static void ltq_etop_hw_receive(struct ltq_etop_chan *ch, struct list_head= *lh) { struct ltq_etop_priv *priv =3D netdev_priv(ch->netdev); struct ltq_dma_desc *desc =3D &ch->dma.desc_base[ch->dma.desc]; @@ -143,7 +142,7 @@ ltq_etop_hw_receive(struct ltq_etop_chan *ch) =20 skb_put(skb, len); skb->protocol =3D eth_type_trans(skb, ch->netdev); - netif_receive_skb(skb); + list_add_tail(&skb->list, lh); } =20 static int @@ -151,6 +150,7 @@ ltq_etop_poll_rx(struct napi_struct *napi, int budget) { struct ltq_etop_chan *ch =3D container_of(napi, struct ltq_etop_chan, napi); + LIST_HEAD(rx_list); int work_done =3D 0; =20 while (work_done < budget) { @@ -158,9 +158,12 @@ ltq_etop_poll_rx(struct napi_struct *napi, int budget) =20 if ((desc->ctl & (LTQ_DMA_OWN | LTQ_DMA_C)) !=3D LTQ_DMA_C) break; - ltq_etop_hw_receive(ch); + ltq_etop_hw_receive(ch, &rx_list); work_done++; } + + netif_receive_skb_list(&rx_list); + if (work_done < budget) { napi_complete_done(&ch->napi, work_done); ltq_dma_ack_irq(&ch->dma); --=20 2.46.2 From nobody Thu Nov 28 11:39:34 2024 Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B70901BBBDD; Tue, 1 Oct 2024 18:46:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727808374; cv=none; b=WdlM3aNBCTSPuDwPDtcSnemxKK413mKg23doTevjjBVXUvwQQ+S5LC3NBABPXnwU872CaDFZ5/uNFYn0tO83fTFvqpooyI9r5hXwzW2thjro87AysOQPbDP5Ms2LGgWiEb+3VmaSSTL5VaOyD56i2y9Qsx4JbIPm7pDBiEXsNE8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727808374; c=relaxed/simple; bh=4rApQvoi1yzj6doZCeZpbx6q0hq8Gy8NRE4rqCrnYxE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DScVIxxHcB2oJZvKBXrkCkMivAWc9Q+MOzm8yLlmAWSnJj5Y+wVGnHsNX+lHhnTCuTqEZYBazJgzV67i5dw7RrJqdUBPHFmNQaBFSKUooRYHcKdNImEvUpDt2ynNHl0chYbCAE6ffUVl6/9QcjNH8/r5fLKSJJ83mBACUZoYbPM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=SqytChVr; arc=none smtp.client-ip=209.85.214.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SqytChVr" Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-208cf673b8dso59691525ad.3; Tue, 01 Oct 2024 11:46:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727808372; x=1728413172; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=6ABkpUrk1T/AeyBT8TSM+jedPOwNaiAliAZdMWlHabI=; b=SqytChVrKE4+BCrKwpqnDQFlv5MAgU9+t3TaYDpa6R0SwJd0l66me16t6LH60qEHqu GNzupfkdPRIt7f0tqSseYYevO3Gx1oEZvujGccICsSUtq4hEgI93Loljv9TdAMq1tg+C bGp5HQswziNUVPXhJL890xTjtWXqMchMYTgdrQgteEjdr/1Ff5BGVfgZ3iAc7n4O/aQV QVl0RcjIEpn5qGIkIFKRKojxeHBRsCR4cJ4FWmvuTwxmC+pet5tcsFzaV9ljrmJDgstN XKamBaO6xseoKuynPMQQo5d/RJ2gzPQi0x/fgNbJvlvMu0n6/Tg25eiN+V8z4DW2va83 bWYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727808372; x=1728413172; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6ABkpUrk1T/AeyBT8TSM+jedPOwNaiAliAZdMWlHabI=; b=SMrzp/BIOq9m4+Ax7onIN3oLDjJfAGJtKTIqr8plfR9PVgIrgDb5vhxXIbiA5V4iU3 9xBt53TiAUMwulQBYWTWidR+goU7DymQ+uP+xaXVtmuXRZ3951j1Fe3wdtSb6U9lC1Bb //4oekeKM+tFPNL8wOqOlUp86QzC9FANctvdsiGQmTD+0QYdkqeriJf/O3d2Fj56rQxy SFmMkAQEsZEkqIZf7VyI4kdrx9AGGI11MQQ6KeAj0e2+40vrMIG5xte8F5euI//FDE9+ sztJG+0jneul6inNKo8LIj+ksikAK5g3h10o2avvBf40YKKBiDWEjxxql8hT6abXNSEJ huAg== X-Forwarded-Encrypted: i=1; AJvYcCWNV+YhsdZ7Tu5APSX5o1pm3FytoOX977apztoF5NNAGLgNm5Kwi1Rb4kgx5KYiBsfGNjf39O8yVIId3pc=@vger.kernel.org X-Gm-Message-State: AOJu0Yyeb2kV0V4fPkTc70hb21KQkvjdkM+/srDffai+6V/h8+emxfr2 A3oaOIliJ9b3bnEg5vqOfIcXah4TxZa42SVfvGiE6IQOU3a3OezVSK8zTRfF X-Google-Smtp-Source: AGHT+IHh7v71Ub9/7I1Up4sjuqlA0eouLr0R04zFxulQU40cbt/ujaoB7jnjjG2AUmpeYs+LdiO7vQ== X-Received: by 2002:a17:903:32cb:b0:20b:adec:2a26 with SMTP id d9443c01a7336-20bc5a0a81dmr9701425ad.15.1727808371881; Tue, 01 Oct 2024 11:46:11 -0700 (PDT) Received: from ryzen.lan ([2601:644:8200:dab8::a86]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20b37e357absm72278965ad.190.2024.10.01.11.46.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Oct 2024 11:46:11 -0700 (PDT) From: Rosen Penev To: netdev@vger.kernel.org Cc: andrew@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux-kernel@vger.kernel.org, olek2@wp.pl, shannon.nelson@amd.com Subject: [PATCHv2 net-next 02/10] net: lantiq_etop: use devm_alloc_etherdev_mqs Date: Tue, 1 Oct 2024 11:45:59 -0700 Message-ID: <20241001184607.193461-3-rosenp@gmail.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241001184607.193461-1-rosenp@gmail.com> References: <20241001184607.193461-1-rosenp@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" It seems there's a missing free_netdev in the remove function. Just avoid manual frees and use devm. Signed-off-by: Rosen Penev Reviewed-by: Shannon Nelson --- drivers/net/ethernet/lantiq_etop.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/lantiq_etop.c b/drivers/net/ethernet/lant= iq_etop.c index 94b37c12f3f7..de4f75ce8d9d 100644 --- a/drivers/net/ethernet/lantiq_etop.c +++ b/drivers/net/ethernet/lantiq_etop.c @@ -601,7 +601,6 @@ ltq_etop_init(struct net_device *dev) =20 err_netdev: unregister_netdev(dev); - free_netdev(dev); err_hw: ltq_etop_hw_exit(dev); return err; @@ -672,7 +671,8 @@ ltq_etop_probe(struct platform_device *pdev) goto err_out; } =20 - dev =3D alloc_etherdev_mq(sizeof(struct ltq_etop_priv), 4); + dev =3D devm_alloc_etherdev_mqs(&pdev->dev, sizeof(struct ltq_etop_priv), + 4, 4); if (!dev) { err =3D -ENOMEM; goto err_out; @@ -690,13 +690,13 @@ ltq_etop_probe(struct platform_device *pdev) err =3D device_property_read_u32(&pdev->dev, "lantiq,tx-burst-length", &p= riv->tx_burst_len); if (err < 0) { dev_err(&pdev->dev, "unable to read tx-burst-length property\n"); - goto err_free; + goto err_out; } =20 err =3D device_property_read_u32(&pdev->dev, "lantiq,rx-burst-length", &p= riv->rx_burst_len); if (err < 0) { dev_err(&pdev->dev, "unable to read rx-burst-length property\n"); - goto err_free; + goto err_out; } =20 for (i =3D 0; i < MAX_DMA_CHAN; i++) { @@ -711,13 +711,11 @@ ltq_etop_probe(struct platform_device *pdev) =20 err =3D register_netdev(dev); if (err) - goto err_free; + goto err_out; =20 platform_set_drvdata(pdev, dev); return 0; =20 -err_free: - free_netdev(dev); err_out: return err; } --=20 2.46.2 From nobody Thu Nov 28 11:39:34 2024 Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1797B1CCEF6; Tue, 1 Oct 2024 18:46:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727808375; cv=none; b=dCxvLUH2HBTqxk0p867sMwcx2qEUwN9EGlj5x97apU7d3Vt8+XV0uIbBKRasynqT2kUxflgQK/b1sIboxoLY3k5cJTyM0nfzzr8SEUOrOjVbrdixQpl8FAPsFy/F6yKMsx5BBy4aWQ5X5fWye3c8fEQzbDqOXrrNhTL6exqX2+Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727808375; c=relaxed/simple; bh=xPkDsZx43SOseO+qGnRGkEPm8IkNs6rkJVu/adMp1pQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=r0rQtDpBkTdVcGLn1oXVHXY1ePzG860UFhUhk2FTWfqD8n/9IlVT3aDdRRsF+H9ChXdr8RPbNiYDehni7oLfTo2lHtHo7ftHwT3VdApnC6k9Gf2wUn5l+hH+Yh7ysVvjUBYuKymA+C7RJ9xAyv600sA8WyPtXFAgMZkuvygRCtE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Cnribtqk; arc=none smtp.client-ip=209.85.214.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Cnribtqk" Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-20bc2970df5so4127955ad.3; Tue, 01 Oct 2024 11:46:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727808373; x=1728413173; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9T8zhMK7/QXeXyb1KNjPbwVsH0PK485frWAFai936ew=; b=CnribtqkH/bkGEujD0qswUuin+PZSBf/a1ZhW3T/+HO2kfbtkt7yJpUvknbS4iHE+u yFlyddLc3Ua7G2KpfVhTnExt9RmIr2dTdJUS5lPzRZ1pqqyszYBrBBPYMHwFtypSsYYP saATGuULMY8NHgwuHsClVU9D2EsxAuBq8Z8EJUGhCFOdmOp3P3PcYjd6z/udOoLUSrl3 7zIsIyFi0CFP7jHvMWpTJb3kvSJBM4EBAJDiMao+wkwTKKvAnuiQkHeus9gQMBTRsPSL qu8eIgWmffcmR1nkUhipj/EvG55QN01QuDnUsmJ5SPT1hSK1hZBTRbak9mQsFem+R3kl Yv6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727808373; x=1728413173; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9T8zhMK7/QXeXyb1KNjPbwVsH0PK485frWAFai936ew=; b=JVEEjlJyEK8qTcQZJL0GjONd5171XkpYDGDqOI+KWN8nDj8JAMNLWetGpZJzyE6Sb6 hPE6hKj2n4GbbFBczTyAsvQax6NthDNrDnKRQTHL6keDZ4Q+3qOcLLT4OqSMEHxJyJBK 03PGYe9JYxHzXntb2rskwXTA/D5u86v62VdQnn2zFYE+ZGEcK4VpfnuzoHTc9k74aZAh 1xmUE6hf3KsAFen0Q2o5SZZEi2M7kN/TUFA3aqzZB+G62if/7yFN8/Zpjk0Z3hOauvaQ 6X+CLVWisSmkJdi3fEYr+WzkekPREsJBT/8tkiEeAHXxEd/RVRtHgWu/fvbowKAObQts 8Qww== X-Forwarded-Encrypted: i=1; AJvYcCWgf/c7lpSqY2+zI7BZXNcsQDHyMW97Sy2kfPr9TSfwP2Ia1pf+l34jaQnVUOtAGkBkcgFUJ92mVOiWkfM=@vger.kernel.org X-Gm-Message-State: AOJu0Yy3DKRj34itJGFwhSfI0CPsplfJIolmRu1MKUMWET+QS0+NNdUK RMUVJw+hlMT7VrrB4SI5Esh7CWgOudX7HEzvmlVPs1XoREOLISNZ2cTqfTeb X-Google-Smtp-Source: AGHT+IFM9x9loC5Fj/CvSYm9pFjjbJTgU96yAV4x2ekZnol57QZNNk6dlPuQ+jPkxllXYjltw46CaQ== X-Received: by 2002:a17:903:41cc:b0:20b:532d:bb17 with SMTP id d9443c01a7336-20bc5a6b3acmr6716735ad.54.1727808373234; Tue, 01 Oct 2024 11:46:13 -0700 (PDT) Received: from ryzen.lan ([2601:644:8200:dab8::a86]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20b37e357absm72278965ad.190.2024.10.01.11.46.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Oct 2024 11:46:12 -0700 (PDT) From: Rosen Penev To: netdev@vger.kernel.org Cc: andrew@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux-kernel@vger.kernel.org, olek2@wp.pl, shannon.nelson@amd.com Subject: [PATCHv2 net-next 03/10] net: lantiq_etop: use devm for register_netdev Date: Tue, 1 Oct 2024 11:46:00 -0700 Message-ID: <20241001184607.193461-4-rosenp@gmail.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241001184607.193461-1-rosenp@gmail.com> References: <20241001184607.193461-1-rosenp@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This is the last to be created and so must be the first to be freed. Simpler to avoid by using devm. Signed-off-by: Rosen Penev Reviewed-by: Shannon Nelson --- drivers/net/ethernet/lantiq_etop.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/lantiq_etop.c b/drivers/net/ethernet/lant= iq_etop.c index de4f75ce8d9d..988f204fd89c 100644 --- a/drivers/net/ethernet/lantiq_etop.c +++ b/drivers/net/ethernet/lantiq_etop.c @@ -587,7 +587,7 @@ ltq_etop_init(struct net_device *dev) =20 err =3D ltq_etop_set_mac_address(dev, &mac); if (err) - goto err_netdev; + goto err_hw; =20 /* Set addr_assign_type here, ltq_etop_set_mac_address would reset it. */ if (random_mac) @@ -596,11 +596,9 @@ ltq_etop_init(struct net_device *dev) ltq_etop_set_multicast_list(dev); err =3D ltq_etop_mdio_init(dev); if (err) - goto err_netdev; + goto err_hw; return 0; =20 -err_netdev: - unregister_netdev(dev); err_hw: ltq_etop_hw_exit(dev); return err; @@ -709,7 +707,7 @@ ltq_etop_probe(struct platform_device *pdev) priv->ch[i].netdev =3D dev; } =20 - err =3D register_netdev(dev); + err =3D devm_register_netdev(&pdev->dev, dev); if (err) goto err_out; =20 @@ -728,7 +726,6 @@ static void ltq_etop_remove(struct platform_device *pde= v) netif_tx_stop_all_queues(dev); ltq_etop_hw_exit(dev); ltq_etop_mdio_cleanup(dev); - unregister_netdev(dev); } } =20 --=20 2.46.2 From nobody Thu Nov 28 11:39:34 2024 Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3C8231CDA3F; Tue, 1 Oct 2024 18:46:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727808376; cv=none; b=lPYbreZphiO64VL3XiInlpO609ndL6ZZFrb+YthiA8uD6n7tR/TtmqnnTODfY7+7oWsVeTPU6895UBMyA1A+bXioGyYNWtekfHGj7N32XSlUTlubFpSv0JjoGlh1gXyh2egfV1N/S7g4PnUOWbd5xAUkc7BYN5oXVCSNs5Tv/Vw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727808376; c=relaxed/simple; bh=RV8dk0EnCulbVbPhN8hMIAvbnxDjyjvcVSxawAEPebE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FCd7ne1o5UeqInK1ZWSoXNApbcnpm4n8Y4qYqXjlGXpxadqkx3tgQYqRutnlyVVOue6f76TN3DEXjko8gygFCoOC2UeJL2/aosgSF6j3TKfnsZ9Y6ouzEZir59LiQWNhldvLMkmX1k71zTbJiaN7z0No7Q4ICo7DK/lmdhITc0A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ZhqZfTe/; arc=none smtp.client-ip=209.85.214.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ZhqZfTe/" Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-20ba9f3824fso11406385ad.0; Tue, 01 Oct 2024 11:46:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727808374; x=1728413174; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=MF8fdTeeyPCDuzbPxMkFvzHsTUX68pxONz2CuYTvJXQ=; b=ZhqZfTe/eVIP002zkEh5HMukSV2bXI/cIkBHHnF8EYoO7uz+Hni4st2l3RlsyN+xX6 vid5ej5tbgayFiPJb8ZM+WGi4fa37FEYATEOXM9rAit36+R93n+a6pMkVK5E7/lcZUOV uf/n16GnP7shy0FDq/+9pDnPLK0XjKrLv64ruiCVKICoTJnoSCYNy+exGGn3HD8tL/YT CMj8zn7+cgOjnkghjcCptpPs1yZbjfgbHykc65NO96FYy1FxWC5lD+7co73dzYLWELJJ Hd8sRrLouBMxfdrj4byGaRWPbDSfMtaGpIGmdbtQPqG33UCXYoX66Dj8Enyjte3f0ekU 35fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727808374; x=1728413174; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MF8fdTeeyPCDuzbPxMkFvzHsTUX68pxONz2CuYTvJXQ=; b=E/Wt9R9GR1UsF2ZJqhfKuQWdYTJ4m2phKjgWlMb3ypgHGtX+ZvOKPKuh9ucvxoibpI RaUGjnulTz/cVSeYXQ6aUTqZEjxZI9kNwM4fUCpNKxX85iyOBmnmqjdlt3542OAwsoEO m5xjeG0PcCHG/vSTT0OojJ8frPZItrYrnHYDaG2Uzpgo+ZOPDKL3K+gwUnqAurOkDMGi 2r8JZ43QdWYfFRA4H7seqnDn4EURjpbYC13oMHiPXVlf4QEXa1CvNaEa2Vkymb/DdVd2 SPD9B/KPISSJ5/LVYTs1q65SZGBD7/knDuH0XVARTevWe9naW9uscL6tLW3vKz5Rvu5q iYrw== X-Forwarded-Encrypted: i=1; AJvYcCV0vzDHhBZnqfCvHV1Zp5vGqkxtzovt4F6FiNTobtvNlazrB2ioEG4QR4tgOjB7zD5W+rnyVo5xECu/eLs=@vger.kernel.org X-Gm-Message-State: AOJu0Yxo/Q3QsSG3k4WGylX5uk6wKhRNR23ug+Hg0tfaRltXXIIlohV0 4a/qIYTslV26xCaS8yjg7Pj6ahptAVn58EmY/2wR6c8aRcGYOT3EqHa5EP+V X-Google-Smtp-Source: AGHT+IEcpDHQdgDEQUV/i2PiQjQtI2wjoEzXOp6LH/gPonhPbP5/zGR7EzDdrI4RxPpnLt5+Rjj4BQ== X-Received: by 2002:a17:903:2301:b0:20b:78de:c62c with SMTP id d9443c01a7336-20bc5a4eb00mr7751185ad.39.1727808374533; Tue, 01 Oct 2024 11:46:14 -0700 (PDT) Received: from ryzen.lan ([2601:644:8200:dab8::a86]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20b37e357absm72278965ad.190.2024.10.01.11.46.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Oct 2024 11:46:14 -0700 (PDT) From: Rosen Penev To: netdev@vger.kernel.org Cc: andrew@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux-kernel@vger.kernel.org, olek2@wp.pl, shannon.nelson@amd.com Subject: [PATCHv2 net-next 04/10] net: lantiq_etop: use devm for mdiobus Date: Tue, 1 Oct 2024 11:46:01 -0700 Message-ID: <20241001184607.193461-5-rosenp@gmail.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241001184607.193461-1-rosenp@gmail.com> References: <20241001184607.193461-1-rosenp@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Allows removing ltq_etop_mdio_cleanup. Kept the phy_disconnect in the remove function just in case. Signed-off-by: Rosen Penev Reviewed-by: Shannon Nelson Reviewed-by: Andrew Lunn --- drivers/net/ethernet/lantiq_etop.c | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/drivers/net/ethernet/lantiq_etop.c b/drivers/net/ethernet/lant= iq_etop.c index 988f204fd89c..d1fcbfd3e255 100644 --- a/drivers/net/ethernet/lantiq_etop.c +++ b/drivers/net/ethernet/lantiq_etop.c @@ -391,7 +391,7 @@ ltq_etop_mdio_init(struct net_device *dev) struct ltq_etop_priv *priv =3D netdev_priv(dev); int err; =20 - priv->mii_bus =3D mdiobus_alloc(); + priv->mii_bus =3D devm_mdiobus_alloc(&dev->dev); if (!priv->mii_bus) { netdev_err(dev, "failed to allocate mii bus\n"); err =3D -ENOMEM; @@ -404,35 +404,21 @@ ltq_etop_mdio_init(struct net_device *dev) priv->mii_bus->name =3D "ltq_mii"; snprintf(priv->mii_bus->id, MII_BUS_ID_SIZE, "%s-%x", priv->pdev->name, priv->pdev->id); - if (mdiobus_register(priv->mii_bus)) { + if (devm_mdiobus_register(&dev->dev, priv->mii_bus)) { err =3D -ENXIO; - goto err_out_free_mdiobus; + goto err_out; } =20 if (ltq_etop_mdio_probe(dev)) { err =3D -ENXIO; - goto err_out_unregister_bus; + goto err_out; } return 0; =20 -err_out_unregister_bus: - mdiobus_unregister(priv->mii_bus); -err_out_free_mdiobus: - mdiobus_free(priv->mii_bus); err_out: return err; } =20 -static void -ltq_etop_mdio_cleanup(struct net_device *dev) -{ - struct ltq_etop_priv *priv =3D netdev_priv(dev); - - phy_disconnect(dev->phydev); - mdiobus_unregister(priv->mii_bus); - mdiobus_free(priv->mii_bus); -} - static int ltq_etop_open(struct net_device *dev) { @@ -725,7 +711,7 @@ static void ltq_etop_remove(struct platform_device *pde= v) if (dev) { netif_tx_stop_all_queues(dev); ltq_etop_hw_exit(dev); - ltq_etop_mdio_cleanup(dev); + phy_disconnect(dev->phydev); } } =20 --=20 2.46.2 From nobody Thu Nov 28 11:39:34 2024 Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CADF41CEAAD; Tue, 1 Oct 2024 18:46:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727808378; cv=none; b=jx2BoN7z9Bj5dCuohDv2r8kDaqA7SOpOgwh4tr0d/92jGj8/0+TzlgEEFA8s9ZJbNuTxDHAOR28D4OqohoS5pGGV7axsWRzEYQwE8FgdV3Sd4P73HH3MMCP8C07jpnY24BjmrSOaCrw0+EoNxWeWoDjiaG9ZLO91A7vXMQeIoaE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727808378; c=relaxed/simple; bh=46GVykT6SX+LlJ6jm/yAcXTk9kODUQH0b7YRv9z9aDc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DpaMWuGU8rmvYnmhksiC5jRz06iJ6DGMU4M5ouBoGHiKR70jdpq5878xM6dgdZwiIDj3upoaRF51DnLgbjxCFDDpBiGcqCNqNAGTvQK8bv5iX0AE0shrjEJMxcZxC+WKwAi/DF/20YuwmfjDJBBChU82DStJtS0OkGEXaZef2GA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=bjmusiZG; arc=none smtp.client-ip=209.85.214.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bjmusiZG" Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-20b01da232aso766315ad.1; Tue, 01 Oct 2024 11:46:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727808376; x=1728413176; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=cbgRMhvLgzToQp3FK/UHWQovuPUhRbZqbf3H6v2KiJM=; b=bjmusiZGeKIrpLDlUZUm5A43cWCJYtBqUJAxE1jWg7yxWII8Qm2VIbifx8IKVKRoWM s4QlJVNhRcVuePGdPUqRS2X9Eqz7AFK46qsZwlIpmqYoeRrz+nC5FKzqI/I9i7JOqUEL oX+vJM45dx97h/jbNuFPCsSsy4WcBqawkFzDSc3ktyZxK17l67DuuuIVfOwDJJV4HQ34 9Lgw/BoBqjLcp2lqwgVfK0UrGABFxWjMwSUnHDOxJTa2tc33By8r39Abhtkv+yJU+3Pm DXzJ/LLh/YJ0frVvyaXvLqjFZ3nlW4pcxGFWi7hzq9gKN0rm4nFSEAQXZb5ZRfL3ptjY UjUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727808376; x=1728413176; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cbgRMhvLgzToQp3FK/UHWQovuPUhRbZqbf3H6v2KiJM=; b=vz1BRdBmBZ5xxMJwgoBM5czL7lgg3O9YVWFNx3IYrlMBXibJ4npp+wXaPQjoxxdK1P Q3lfOQuaMnxORHu+Yqn8a6QFgQLY2k0wE9UwL6DrVqkYKMUp+JI6zf+3vQ+lDb/MyVxs p45QWAbhmIVCmn+u+gbnL7GYrwytsEO5Aga2SdraVHEjwTred4f91HJBLrqJWYgyDuQf lvJBD4jPxw5aLTQq31IFY/Vn/2hDdR0gwfgmOoVhcyN2Y2/KOZiVrz1YvFMlTdD3xOfN 7wAQaaEWnZk5RAY8l9JdgFtzpwImK+mhPVbMVFauO5xzhlIvUeMHIGb3YsTqVbFrcAJK RNNQ== X-Forwarded-Encrypted: i=1; AJvYcCWStz+ivyJwaUfuRjmPyPZ+cdRvbHqqhHw650BT0ScPbx7CQ5BJtcwSg3YsjjsA9dnIekokuNwA5JyEW2A=@vger.kernel.org X-Gm-Message-State: AOJu0YyRz5/KcKvb36oZ7Ljgfh2zyvSQlw4wTtJ/JsBxe5n934S8cDLv j+txirlGI/tSiaZtyMqXD6AOHUVlyMLv25eBUuqsCj/g6bkwHje6C5so+mY8 X-Google-Smtp-Source: AGHT+IHbDWyA114ABuIxQsPZCAYlI9Xdmw59CL2Ff2AaJvvzn2eE9rYXzIZz52sLa7tk9CiPxjHP/w== X-Received: by 2002:a17:902:f791:b0:20b:a8ad:9b0c with SMTP id d9443c01a7336-20bc5b66b7emr7548425ad.3.1727808375913; Tue, 01 Oct 2024 11:46:15 -0700 (PDT) Received: from ryzen.lan ([2601:644:8200:dab8::a86]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20b37e357absm72278965ad.190.2024.10.01.11.46.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Oct 2024 11:46:15 -0700 (PDT) From: Rosen Penev To: netdev@vger.kernel.org Cc: andrew@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux-kernel@vger.kernel.org, olek2@wp.pl, shannon.nelson@amd.com Subject: [PATCHv2 net-next 05/10] net: lantiq_etop: move phy_disconnect to stop Date: Tue, 1 Oct 2024 11:46:02 -0700 Message-ID: <20241001184607.193461-6-rosenp@gmail.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241001184607.193461-1-rosenp@gmail.com> References: <20241001184607.193461-1-rosenp@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" phy is initialized in start, not in probe. Move to stop instead of remove to disconnect it earlier. Signed-off-by: Rosen Penev Reviewed-by: Shannon Nelson --- drivers/net/ethernet/lantiq_etop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/lantiq_etop.c b/drivers/net/ethernet/lant= iq_etop.c index d1fcbfd3e255..9ca8f01585f6 100644 --- a/drivers/net/ethernet/lantiq_etop.c +++ b/drivers/net/ethernet/lantiq_etop.c @@ -447,6 +447,7 @@ ltq_etop_stop(struct net_device *dev) =20 netif_tx_stop_all_queues(dev); phy_stop(dev->phydev); + phy_disconnect(dev->phydev); for (i =3D 0; i < MAX_DMA_CHAN; i++) { struct ltq_etop_chan *ch =3D &priv->ch[i]; =20 @@ -711,7 +712,6 @@ static void ltq_etop_remove(struct platform_device *pde= v) if (dev) { netif_tx_stop_all_queues(dev); ltq_etop_hw_exit(dev); - phy_disconnect(dev->phydev); } } =20 --=20 2.46.2 From nobody Thu Nov 28 11:39:34 2024 Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 331B51CEAD5; Tue, 1 Oct 2024 18:46:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727808379; cv=none; b=Funb85vRN4lae2WXdix+/wuHcUZo/vz9mODfYgzZ7KJlUhN+BgHj6k+SBd/iu32FIqI8OeiUhDTEeiTfjV9Y05di5gJxqwi8xr0UJ2K2i4V19BfGaOu4KfRymsOigc9Ycz9OEnhiIC3JU3ATd+fPFRthyJpw7qFTCbVrb8wSUhA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727808379; c=relaxed/simple; bh=EXhXd2czwyGbcYG1c8wXdvFk9fg01yOquF/Do5eADb8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=b2uw/AZT8zaZNeA57gHuHCD22aumJE7sUX4gyd3L11akDpDccPhAxz8cbDM1L6YAEP0SktEBv+7rgvHTPL5OWu26KFg5F3j0hbumuWIsbLfgE/NoA482R8wCg4tyNqB697l6A2sXUni7/mFQExbFR1BtsRz81p2L92GlFDu/OpA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=BP+K1dMx; arc=none smtp.client-ip=209.85.214.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="BP+K1dMx" Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-20aff65aa37so47532565ad.1; Tue, 01 Oct 2024 11:46:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727808377; x=1728413177; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fwUbJMNR0/QyvDYOplb8XoUvdN2UCOFTaKGE+xFOxaI=; b=BP+K1dMx3ixFiMVPcC5bkO8VDLSZcubQj6WGiC5WJ+2LWYSiNDyRvUVVOlL3vTH9ZV thiqeXXotNiJU8DN/TwBqRCobPbjCkUMsM1UInC+erVpBpYX7O/tekRHAHJOweOm7Qfm UC5/caEYJKM+L7I3lMwLuKN1Z7f0eSk9UwAS7IO5zMBT17AjEBM0s7783vnen5vHlnzo XSqJb22yivCR9VKAbGGyoKsavE7F5xFC/5r3gopqpTYWfzoYxOKtGLfFOj4KZlxXGZK5 VP+j4ixnEDGhNp2lR/K2ZiUn9kM5Hqm7MsaM3pDumRuQh3gAzPWCMV2iDV73/R6aYRsl /+0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727808377; x=1728413177; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fwUbJMNR0/QyvDYOplb8XoUvdN2UCOFTaKGE+xFOxaI=; b=ZKgw/gKAEYJyAppqFS6TbWfIl0HnI+BzmJXXrTkccoq0gIk0As9m+HnuyomMvetyaQ /bPCXdjogsDaViDsqNhM4vPi328CDi1TIKyUrqo50v0IOitIEOEsjx3r3VATj83mHnwz 9B3eefPk3w7Y2FOwlOUiqLHZkS+8sLu4s5LbDYFWzPmwxZcJlIhBpXA7vFT9h3uUMcB2 RqWTKo3hp62F48p7K5H365qtV5H8eZxK2tunXFnyi2ImkyOdFf8wRwoRfV+pBGN9P+tf 3Ax6cPvdaS54J8dAXXjOV8pfaxXrqGU+7ChIYVd8BQpnGtwkg0Zk2zdtLEeZE+2XtpSa FcAA== X-Forwarded-Encrypted: i=1; AJvYcCVpO/9wPnUVVAfghwH+RyGamiq+wqeBZKpnHf0epFlhcKFO1TST4bCMjjKKKGjMVBH3naS7SUq8/RHgC/0=@vger.kernel.org X-Gm-Message-State: AOJu0YxY1SwS3WiA4QwTA9ZLwaRDMluduNVkZmcFkKGeM7t/qPG+sVMi 3roQTUbpUbi1BsYCJWsXj1aoVd2zvw3d8SSiInmuI44qq0Qbj9OmsxtlfopE X-Google-Smtp-Source: AGHT+IHH2lu7AhQQAI3wILcCpgu8yQRH9ruAHyDNDaQryuq5nizoTWMUJtJ7tQTD1h/ywlEwyTELLQ== X-Received: by 2002:a17:902:c404:b0:20b:5db2:4565 with SMTP id d9443c01a7336-20bc5aa3d49mr7139645ad.56.1727808377319; Tue, 01 Oct 2024 11:46:17 -0700 (PDT) Received: from ryzen.lan ([2601:644:8200:dab8::a86]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20b37e357absm72278965ad.190.2024.10.01.11.46.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Oct 2024 11:46:16 -0700 (PDT) From: Rosen Penev To: netdev@vger.kernel.org Cc: andrew@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux-kernel@vger.kernel.org, olek2@wp.pl, shannon.nelson@amd.com Subject: [PATCHv2 net-next 06/10] net: lantiq_etop: use devm_err_probe Date: Tue, 1 Oct 2024 11:46:03 -0700 Message-ID: <20241001184607.193461-7-rosenp@gmail.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241001184607.193461-1-rosenp@gmail.com> References: <20241001184607.193461-1-rosenp@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Also remove pointless gotos that just return as a result of devm conversions. Signed-off-by: Rosen Penev Reviewed-by: Shannon Nelson --- drivers/net/ethernet/lantiq_etop.c | 61 ++++++++++-------------------- 1 file changed, 21 insertions(+), 40 deletions(-) diff --git a/drivers/net/ethernet/lantiq_etop.c b/drivers/net/ethernet/lant= iq_etop.c index 9ca8f01585f6..bc97b189785e 100644 --- a/drivers/net/ethernet/lantiq_etop.c +++ b/drivers/net/ethernet/lantiq_etop.c @@ -389,13 +389,11 @@ static int ltq_etop_mdio_init(struct net_device *dev) { struct ltq_etop_priv *priv =3D netdev_priv(dev); - int err; =20 priv->mii_bus =3D devm_mdiobus_alloc(&dev->dev); if (!priv->mii_bus) { netdev_err(dev, "failed to allocate mii bus\n"); - err =3D -ENOMEM; - goto err_out; + return -ENOMEM; } =20 priv->mii_bus->priv =3D dev; @@ -404,19 +402,13 @@ ltq_etop_mdio_init(struct net_device *dev) priv->mii_bus->name =3D "ltq_mii"; snprintf(priv->mii_bus->id, MII_BUS_ID_SIZE, "%s-%x", priv->pdev->name, priv->pdev->id); - if (devm_mdiobus_register(&dev->dev, priv->mii_bus)) { - err =3D -ENXIO; - goto err_out; - } + if (devm_mdiobus_register(&dev->dev, priv->mii_bus)) + return -ENXIO; =20 - if (ltq_etop_mdio_probe(dev)) { - err =3D -ENXIO; - goto err_out; - } - return 0; + if (ltq_etop_mdio_probe(dev)) + return -ENXIO; =20 -err_out: - return err; + return 0; } =20 static int @@ -634,34 +626,28 @@ ltq_etop_probe(struct platform_device *pdev) =20 res =3D platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!res) { - dev_err(&pdev->dev, "failed to get etop resource\n"); - err =3D -ENOENT; - goto err_out; + dev_err(&pdev->dev, "failed to get etop resource"); + return -ENOENT; } =20 res =3D devm_request_mem_region(&pdev->dev, res->start, resource_size(res), dev_name(&pdev->dev)); if (!res) { - dev_err(&pdev->dev, "failed to request etop resource\n"); - err =3D -EBUSY; - goto err_out; + dev_err(&pdev->dev, "failed to request etop resource"); + return -EBUSY; } =20 ltq_etop_membase =3D devm_ioremap(&pdev->dev, res->start, resource_size(res)); if (!ltq_etop_membase) { - dev_err(&pdev->dev, "failed to remap etop engine %d\n", - pdev->id); - err =3D -ENOMEM; - goto err_out; + dev_err(&pdev->dev, "failed to remap etop engine %d", pdev->id); + return -ENOMEM; } =20 dev =3D devm_alloc_etherdev_mqs(&pdev->dev, sizeof(struct ltq_etop_priv), 4, 4); - if (!dev) { - err =3D -ENOMEM; - goto err_out; - } + if (!dev) + return -ENOMEM; dev->netdev_ops =3D <q_eth_netdev_ops; dev->ethtool_ops =3D <q_etop_ethtool_ops; priv =3D netdev_priv(dev); @@ -673,16 +659,14 @@ ltq_etop_probe(struct platform_device *pdev) SET_NETDEV_DEV(dev, &pdev->dev); =20 err =3D device_property_read_u32(&pdev->dev, "lantiq,tx-burst-length", &p= riv->tx_burst_len); - if (err < 0) { - dev_err(&pdev->dev, "unable to read tx-burst-length property\n"); - goto err_out; - } + if (err < 0) + return dev_err_probe(&pdev->dev, err, + "unable to read tx-burst-length property"); =20 err =3D device_property_read_u32(&pdev->dev, "lantiq,rx-burst-length", &p= riv->rx_burst_len); - if (err < 0) { - dev_err(&pdev->dev, "unable to read rx-burst-length property\n"); - goto err_out; - } + if (err < 0) + return dev_err_probe(&pdev->dev, err, + "unable to read rx-burst-length property"); =20 for (i =3D 0; i < MAX_DMA_CHAN; i++) { if (IS_TX(i)) @@ -696,13 +680,10 @@ ltq_etop_probe(struct platform_device *pdev) =20 err =3D devm_register_netdev(&pdev->dev, dev); if (err) - goto err_out; + return err; =20 platform_set_drvdata(pdev, dev); return 0; - -err_out: - return err; } =20 static void ltq_etop_remove(struct platform_device *pdev) --=20 2.46.2 From nobody Thu Nov 28 11:39:34 2024 Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8E9CF1CEE9C; Tue, 1 Oct 2024 18:46:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727808381; cv=none; b=tiuma0ip2mvJo80tzq0D4kzCK6rS1XlJwWTC3T6dutZ370q/EzLiD0lZD1YwMrr7ZO1ueLCn/eq5VHCpSjb6r7d3zyazzZKxHli6UeJjXm0h6F4GDzFASbWVYirclk2Q4pDrk7DPpmKVjSKYXHBMLwEdXVY1bWbNo67ZxCXHa7Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727808381; c=relaxed/simple; bh=fI8TqUvkenD8MKRItkOfndP9FbS6xNUBuWmVFpeuOm0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AweiCpvRKNHufoz2zvHBT2iwX4Km0m8Xj5x1LKaJ6ODFMDwFZ9ZOgfQ82lbBR0ykvn3AA4x1lICgwG1OqoBRlMTb692X6e7XzXV3YlnR+ntBx+lX1pLt2Be31gjRv2RPSTDKix+eElsQurZXDbLtgEDn7WiKQFKDNBeCq8CIaUw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=HgqkxQoI; arc=none smtp.client-ip=209.85.214.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HgqkxQoI" Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-20bb39d97d1so9042825ad.2; Tue, 01 Oct 2024 11:46:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727808379; x=1728413179; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=psQ8za/3DIn0xibnh4ZYDayf2hGKFHVv3+R+/mtl++U=; b=HgqkxQoIWDU1a4xXeTE2Vg+f8alg4nich23pMQQQl7fU2jctZ0m/Ic3HyRpoqt4vms Q9ER9b91gXKravL8ikx8DDIJue64QADE6ZWFcACaLXLEdNRNiZHV53gAC7CFyuT4sEEd JFqHXg6Oqf3DPhpJ+kzjTWn/ENQsMYsmCTm+5EETIZHes7G6Dj4+YsJvnkAg/oaqzgww 9TVHUBapwAbQqC5nFre9q4OIzXycN2uETtgylNSdiBxanfNBBmZ0W1PptNGQsSDQrEsZ /nJZduMKSPbIO1dlr4ZhBFQggsuUsdG80ocolSbFe23/5sy29Rb0q4WbhfMX3074IV3l CJgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727808379; x=1728413179; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=psQ8za/3DIn0xibnh4ZYDayf2hGKFHVv3+R+/mtl++U=; b=mVYuJDihCEwI/nlo/Mkm+drbuFzRrIxnImiJLvN9ftQQmUvKAnHQ0c8vOF5Wr5/Ju9 mZVzxcttUwG+FYYOqz76PZBQ32J3Qeo5GFQx94To96bcBCJaYiA2LMmJtd5hSDPx7Pjc jJoLf4KwDsX+LdMpWoOackOuRETDskuQHnNof9ylXij5BcZ5Y8T8G1bQ7kcKcF4M1JdP 5uLZJa6BPAHkTNFtLL5nVdAxPddZo3FBgQdc9lf+wK/eX8eNUu6CutZRyIOeapZwDGp5 kMq/PyqCRCIUFoFQVQJWw9sWrR+3ktBK9ENNn8R40gGWtMpLxr/OigLu5k2Bmr5LVl2j ubhg== X-Forwarded-Encrypted: i=1; AJvYcCUWOT2tSqnEjS95JV3uTUUbiXt+tK9HvZflyee2TBum4TMN3T0deP6C3hUl6R9zY+XxRBjCdM4PkKX6yxw=@vger.kernel.org X-Gm-Message-State: AOJu0Yx5F2o1HUkgp43PdzV5gMHwkIvXoBybpwziVlmip/vpvjTyQJZj Vn6LKdWUaFi+IYT71LzJzbPfK6tIYHBWm3il9Q74ArYGlcTqhX1KCEPPoBdn X-Google-Smtp-Source: AGHT+IFVvh93jwQmfcnfI/PtarNMVEhS9ZNmnvP7Nna1JNQ573NA8WSAMAGUgo9CZ9hJyOaNnB4Hjg== X-Received: by 2002:a17:902:e743:b0:20b:a0ed:2455 with SMTP id d9443c01a7336-20bc59e5250mr8072405ad.20.1727808378672; Tue, 01 Oct 2024 11:46:18 -0700 (PDT) Received: from ryzen.lan ([2601:644:8200:dab8::a86]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20b37e357absm72278965ad.190.2024.10.01.11.46.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Oct 2024 11:46:18 -0700 (PDT) From: Rosen Penev To: netdev@vger.kernel.org Cc: andrew@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux-kernel@vger.kernel.org, olek2@wp.pl, shannon.nelson@amd.com Subject: [PATCHv2 net-next 07/10] net: lantiq_etop: remove struct resource Date: Tue, 1 Oct 2024 11:46:04 -0700 Message-ID: <20241001184607.193461-8-rosenp@gmail.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241001184607.193461-1-rosenp@gmail.com> References: <20241001184607.193461-1-rosenp@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" All of this can be simplified with devm_platformn_ioremap_resource. No need for extra code. Signed-off-by: Rosen Penev Reviewed-by: Shannon Nelson --- drivers/net/ethernet/lantiq_etop.c | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/drivers/net/ethernet/lantiq_etop.c b/drivers/net/ethernet/lant= iq_etop.c index bc97b189785e..3e9937c7371a 100644 --- a/drivers/net/ethernet/lantiq_etop.c +++ b/drivers/net/ethernet/lantiq_etop.c @@ -90,7 +90,6 @@ struct ltq_etop_priv { struct net_device *netdev; struct platform_device *pdev; struct ltq_eth_data *pldata; - struct resource *res; =20 struct mii_bus *mii_bus; =20 @@ -620,28 +619,13 @@ ltq_etop_probe(struct platform_device *pdev) { struct net_device *dev; struct ltq_etop_priv *priv; - struct resource *res; int err; int i; =20 - res =3D platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) { - dev_err(&pdev->dev, "failed to get etop resource"); - return -ENOENT; - } - - res =3D devm_request_mem_region(&pdev->dev, res->start, - resource_size(res), dev_name(&pdev->dev)); - if (!res) { - dev_err(&pdev->dev, "failed to request etop resource"); - return -EBUSY; - } - - ltq_etop_membase =3D devm_ioremap(&pdev->dev, res->start, - resource_size(res)); - if (!ltq_etop_membase) { + ltq_etop_membase =3D devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(ltq_etop_membase)) { dev_err(&pdev->dev, "failed to remap etop engine %d", pdev->id); - return -ENOMEM; + return PTR_ERR(ltq_etop_membase); } =20 dev =3D devm_alloc_etherdev_mqs(&pdev->dev, sizeof(struct ltq_etop_priv), @@ -651,7 +635,6 @@ ltq_etop_probe(struct platform_device *pdev) dev->netdev_ops =3D <q_eth_netdev_ops; dev->ethtool_ops =3D <q_etop_ethtool_ops; priv =3D netdev_priv(dev); - priv->res =3D res; priv->pdev =3D pdev; priv->pldata =3D dev_get_platdata(&pdev->dev); priv->netdev =3D dev; --=20 2.46.2 From nobody Thu Nov 28 11:39:34 2024 Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 40ED61CF28E; Tue, 1 Oct 2024 18:46:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727808382; cv=none; b=uh3Ov/9AMbjqspk4JQu+fVELDZ4XgB6ucHk35O5uIGovrTRuQrJqW5aelCgfLtV0UKOSopxMrYttmfp1B6HBo3yUi/8GvoRshJkYEeyKeM9ha9tqT/F0ojnQ2Mi53wtKV7acslRsu+ayeSQJgrslmq5H+b//02tbEK5dKUTogqw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727808382; c=relaxed/simple; bh=cobouo/f4vABqffd5D/CFzek6D3mMGa8a75lrC25gLU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RE0S+jbK2KAvrIrDJIgT3hshzTuez0vMUOn4pPdCUpqZnZYaFc7t+f61bkmAK0l/DVudD0Z533eDDpJ2nWj2RkywA4vUtXrybzhECQcKKSCps4U5VKM2MEDXG0nb6Ad79kwv8hHzNEgtiS6OgxOKc5lGOZymNKsxIB0KuC7mf74= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Yu11TMZr; arc=none smtp.client-ip=209.85.214.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Yu11TMZr" Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-20ba8d92af9so14017285ad.3; Tue, 01 Oct 2024 11:46:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727808380; x=1728413180; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=GMYvEJpJG6VhpCaLpa6hP67KqZAfsj8P0XkxYx3TmjE=; b=Yu11TMZrYDESNi0L+J3ktf6dLk4MAOxWMD9sCXeUmvPHywoUVgeU+K+aL898u6vaTN domJx2JRXegJktN4/ZDnwA1D5Cudcen13ImMgT/BNAEmPTJcQ+VzyZ0VpUPzMgikXodf HAWKkNxuYMLtSLr1AqWkzT55Xl5W6q6opxHIUea285eek3ZRfE6B2JQEhy5l+lvPdx4J zIJr5fkdzJsGSZZcxy4uzE2cvfiDxxxZbRIBegh7+NTBGeWGEkf2uUdGXkfBUgPmAY9A YfWbhO3TC22NckPKin9gSgygmTTHmLp1oPtXA5DPq26N8aeeSdjmjv9Sj/VeIhGIlYkR S1Iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727808380; x=1728413180; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GMYvEJpJG6VhpCaLpa6hP67KqZAfsj8P0XkxYx3TmjE=; b=lu03G3xtGaJLRCnNiM54eCRqgVZylvMnTmOLvsLGIIQfHfZCrFtrXYh9s4mUtmhZdJ ZOdSFCdosPo8s7Co0IMzFzUJ/4ugYVwaSFLf592a68PpPOFJBh+Wv5qkDxp3iBXWj5S4 FKagffgl2KVtvBz6mUAhxDq5BvxZe3Ui7fnN7NruKpXDdPbv0YahYw5ZPl9anzUw630r p3WhvDZEj8fELdyTWNHophaNpC+bZ9qJKPACGh0v2nc4q2lzgciw9nJFIX0eT+Ydwi6d O+4isDpYLKt4wlFOsegIpaOwxtNYpfFMIC5k5Ndv081w+457BAfuh013bUuzmfL54pZA Fb/A== X-Forwarded-Encrypted: i=1; AJvYcCXahMosujHrLo1JMH4fvrrLoVz1huBLC8+hoqPyvIF5WdWin8rIPOMlGy+9KINwTxakc4+qjNgCt9SfQls=@vger.kernel.org X-Gm-Message-State: AOJu0YxjS+Saa8JqEI9ISJaZicQfT4yFYXMOogaNma/utu+nuAgK9MVH vmIQpClT4v6rpjSSx+z53WfRyN9Xmj4BQEFhyMCK93XMmR5WFgJBXBPbo2UF X-Google-Smtp-Source: AGHT+IGKcgOWQT8O7nCv7T1YnUMdYDiSmgOoUCE+kwvYH6sEih1BHjg6LbZtu+1g3tsHBbJzNos3YQ== X-Received: by 2002:a17:902:ce88:b0:20b:4bc6:1132 with SMTP id d9443c01a7336-20bc5a8ec0fmr6081595ad.46.1727808380562; Tue, 01 Oct 2024 11:46:20 -0700 (PDT) Received: from ryzen.lan ([2601:644:8200:dab8::a86]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20b37e357absm72278965ad.190.2024.10.01.11.46.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Oct 2024 11:46:20 -0700 (PDT) From: Rosen Penev To: netdev@vger.kernel.org Cc: andrew@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux-kernel@vger.kernel.org, olek2@wp.pl, shannon.nelson@amd.com Subject: [PATCHv2 net-next 08/10] net: lantiq_etop: use module_platform_driver_probe Date: Tue, 1 Oct 2024 11:46:05 -0700 Message-ID: <20241001184607.193461-9-rosenp@gmail.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241001184607.193461-1-rosenp@gmail.com> References: <20241001184607.193461-1-rosenp@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The explicit init and exit functions don't do anything special. Just use the macro. Signed-off-by: Rosen Penev Reviewed-by: Shannon Nelson --- drivers/net/ethernet/lantiq_etop.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/drivers/net/ethernet/lantiq_etop.c b/drivers/net/ethernet/lant= iq_etop.c index 3e9937c7371a..1458796c4e30 100644 --- a/drivers/net/ethernet/lantiq_etop.c +++ b/drivers/net/ethernet/lantiq_etop.c @@ -686,24 +686,7 @@ static struct platform_driver ltq_mii_driver =3D { }, }; =20 -static int __init -init_ltq_etop(void) -{ - int ret =3D platform_driver_probe(<q_mii_driver, ltq_etop_probe); - - if (ret) - pr_err("ltq_etop: Error registering platform driver!"); - return ret; -} - -static void __exit -exit_ltq_etop(void) -{ - platform_driver_unregister(<q_mii_driver); -} - -module_init(init_ltq_etop); -module_exit(exit_ltq_etop); +module_platform_driver_probe(<q_mii_driver, ltq_etop_probe); =20 MODULE_AUTHOR("John Crispin "); MODULE_DESCRIPTION("Lantiq SoC ETOP"); --=20 2.46.2 From nobody Thu Nov 28 11:39:34 2024 Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B1AF71CF2B6; Tue, 1 Oct 2024 18:46:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727808384; cv=none; b=XBTPKiBXRDCPSAwXAzP7bWKot9hF6jrb1cJo8UjzngWHzE1JaKx/MWatf0C2aagvnKyC+7tscsZ9/IJ+EuAiXt7nhTOT2UXbsfvg8QpPVD33ee/CV5KbZ4zjHBMJrzjqIHC6nE1GUl8DrUzdBEwlacbXr9dHFLIABOCwMPNn2Qk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727808384; c=relaxed/simple; bh=5qmG+wajx0WCsvKwWcs7IoBgHfua90wDFBVXa2Sha4A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZUOv/Ej8d/KahXBHfGAWmH1in6rdtJDdVJUd7nwGA0CkqtGttiGsULJULVwECgN9IQQSw69j7/3fjz71mpfplmUm4sngRfqnXMvSXqGSHen00Sz8WFjTuCf/vG3maAV89+f/9b9uG7XhksKcuF/pMsXtZ6APzsGrdjeuNqClFU4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=UQ98lMKJ; arc=none smtp.client-ip=209.85.214.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UQ98lMKJ" Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-20bc2970df5so4129065ad.3; Tue, 01 Oct 2024 11:46:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727808382; x=1728413182; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=aMaWOdiRSC2aO/xql7aYnf01wKeeiE3+pOq1iTVYN04=; b=UQ98lMKJxX4Wu60h4fIW5OrMWC/QJ9e1G7gkOMZS3SNpNcOUWyqhcoj2wiM6B56qSB 3YaPYvPx7jl7ej8kcQL50uSLlcVjAMANSy4qKFIoe17Jn12nf3TJ/MF3IljrSGvgx0Hb EM8Fo18CAHlx+pGa/fBYhRuyw11UUOWoC8FBEtjU2eXJJxfA95WLNagbCJxUgUDjps89 8Anftp0aw7QnFQ6zaSAANc6nQxe+zd9q/8kqZofU/p4MFvuQTzqdcoq7DHai18D63Nw3 xxCsytW8C6Q8aac7wpxDU/E4rcj2PD0EfUzEnFaIWvbv6crZpNyJRIJpJ3uQ0kAE5vqL hE8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727808382; x=1728413182; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aMaWOdiRSC2aO/xql7aYnf01wKeeiE3+pOq1iTVYN04=; b=Ju58Zc+1LoOSK2fRERTEneo8MINJ8pcJSTapcay0+VGlnwGXcu2emaOCgSnbAxyQBd ZYioiG4u30YaTQTeGDq9OiR2gKWuzD5Y+JEbqMFUHtXWxDamAk4hPpSdG9TE2Imhabgv FwIMOsWWwIAxEmzBf4Txbs3b7L/jRF6B5JQcr/2reRuJJczQqEBsiP2A3xryQ28jqnVj 4y3cc8CeKqtgM2jw4Vjct36aYYtn8K5K6cm7idt+HIGSOceYUQ90hM35YsWd24/bQTNM kBZnd6RXF76cp7B0YGvi9oAlKewEr5YMs/+CaeeJmCPYa/CKQEq1Vj8xAZ4Pa4UZDsEx 8xhg== X-Forwarded-Encrypted: i=1; AJvYcCUoMjnUSK8qj4/G3CG/Cewge5zxdzQDK6s71cL7PwBvCODiIt2qmOLXTTb4EmK0kz1nduN+DJ2aPk2HQgw=@vger.kernel.org X-Gm-Message-State: AOJu0Yw4EGiQdHJY5AyDBYySqPO8FHhx81ZyTGjQV65IlYSIG418ikQf CBxHVa4R/v983MSWLl65nLIvzF0f6cKb0cCMSvfhsZRsbY0TOxN5Di5vNntA X-Google-Smtp-Source: AGHT+IGn7NyougIRsCMb7tGqFLABL8vHTnqBvJg1QaU1cIgSW1SBziUzjeew/p2R3drMH12emBeCJg== X-Received: by 2002:a17:902:fc8f:b0:20b:8c13:5331 with SMTP id d9443c01a7336-20bc5a4e9ecmr7804205ad.43.1727808381750; Tue, 01 Oct 2024 11:46:21 -0700 (PDT) Received: from ryzen.lan ([2601:644:8200:dab8::a86]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20b37e357absm72278965ad.190.2024.10.01.11.46.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Oct 2024 11:46:21 -0700 (PDT) From: Rosen Penev To: netdev@vger.kernel.org Cc: andrew@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux-kernel@vger.kernel.org, olek2@wp.pl, shannon.nelson@amd.com Subject: [PATCHv2 net-next 09/10] net: lantiq_etop: no queue stop in remove Date: Tue, 1 Oct 2024 11:46:06 -0700 Message-ID: <20241001184607.193461-10-rosenp@gmail.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241001184607.193461-1-rosenp@gmail.com> References: <20241001184607.193461-1-rosenp@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This is already called in stop. No need to call a second time. Signed-off-by: Rosen Penev Reviewed-by: Shannon Nelson --- drivers/net/ethernet/lantiq_etop.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/ethernet/lantiq_etop.c b/drivers/net/ethernet/lant= iq_etop.c index 1458796c4e30..355b96ecc5ec 100644 --- a/drivers/net/ethernet/lantiq_etop.c +++ b/drivers/net/ethernet/lantiq_etop.c @@ -673,10 +673,8 @@ static void ltq_etop_remove(struct platform_device *pd= ev) { struct net_device *dev =3D platform_get_drvdata(pdev); =20 - if (dev) { - netif_tx_stop_all_queues(dev); + if (dev) ltq_etop_hw_exit(dev); - } } =20 static struct platform_driver ltq_mii_driver =3D { --=20 2.46.2 From nobody Thu Nov 28 11:39:34 2024 Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2C40F1CF5E7; Tue, 1 Oct 2024 18:46:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727808385; cv=none; b=DC9bFrldvY0Vn4KECMWG3cFLl7ailW6ZVXeCcMIZA5QirW0n//CXukqlmRngGLX8Jwq1OvV6gd8TDHIPvCojnS2S1f+VLSJUVIeh+/huHnIVFLZ5l4mptaz2XXfE6B2Xct4iIA+IIMOq+e2eBo9NqM6Hg+vyso73Ihwfwynpvn4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727808385; c=relaxed/simple; bh=oBwbWw/9CxaXZnlAYvzrzDct5UB25PbolHF7gOCbSKg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qIxd3g652EhsSVPAuNggNhHa2dZmjcEmAF+Tm63R02Bi/cVZhav7xYOAXZnuqCzO+0fDcaPGOt9/9+NA9rL3mYFXZGCc1R+pVpoANdkM6fkZMdvktFfqm8u6Ys1G/MdgFEcm7eTJENAgN5SScc/Zt2PgiRPG9nHxgrCWB0hUAbM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=MLHtlsF1; arc=none smtp.client-ip=209.85.214.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MLHtlsF1" Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-20b0b2528d8so64572125ad.2; Tue, 01 Oct 2024 11:46:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727808383; x=1728413183; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=MOzq+Xn81iHwv1RE/9XVccEM8Hiiq18ZuIc0MA8ZuFE=; b=MLHtlsF1o77EX5AtS8PhHFprbFGI3S+g0Ef2CEkv9sZLlh9KdoMbrmj7tchbMZM8VM nXktM256orH/FfjWGKczBmYfz/reOuZ7749NeSyBHPhgauv0rjFuj3gtMPIScBZD723m QuON0c7/TGYHzfxEHltmqtjcwVYbUZfFPQ3qHjC1d/KhdKCLGXjfVPLbfiswTvbFH2pJ jzc6HcJw6CtvItf0vXLprv5LWnhz5fThzhLlnBxpALbv0ecw0d2LNbF9r8s70BXDdOiU o4buOBzm1yasgY8UaMMctCgwgWVZDlgTL33SuTciz0mgKpVKGS829gMX6ZYSa/LNlJhu zIfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727808383; x=1728413183; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MOzq+Xn81iHwv1RE/9XVccEM8Hiiq18ZuIc0MA8ZuFE=; b=N4cRG3EwSE0TWlfWZdYNxYK2w7RjDLaaQBNpH6itPf0xplEs29Vq4IP8Tax9w1/OTk dbjZz89mShSBmTxdq4AlFWBAv9vzK5B++sdbaXg3YQMIDbMJQG5S2JNMDtHOqYvDLvxb F+EcEosGAd6mCEN0khyl0p9vgbDfoA2O/SybO7E6b5vbEX0vt2Nw77nfULM1mpu3g8Il q0AZCLbQpU3RSPn8gvLheZG+ks9xKBjJwGp3HCqvZyJNAPLVOo1c6wefLfkiTAiMQ+bT DbLU0nWEnNPHOXvcOH6VLnQfkhHq78RLq0ZmU2VtaO0w1YhlBfFsYFdmTU1EfpvO4VZh WHWw== X-Forwarded-Encrypted: i=1; AJvYcCVq9/jtyxZa4wLc88PdYn9O16nF2B4TyW2P7QqRssMszBkjYONVQgILk3bcgbe3FgeCccoTRZgtgvmioZE=@vger.kernel.org X-Gm-Message-State: AOJu0YxbGmVRlwqKE8gCaxxUnCqIC0cLnX/Bvv/Hbtwxu5FeuA0g3Ugn N0hpJNrbO71f9eA2EkvzUm837JFoRm8hH8Y4guR1WGwD21JMd99hacdYdDiR X-Google-Smtp-Source: AGHT+IGQWNV35HtYSd7MU2z+cP53LTfzA+A+khGoh5hl2bmmBj23E9jKsfe2LtLI52db8lk4uak+aA== X-Received: by 2002:a17:902:ea02:b0:203:a030:d0a1 with SMTP id d9443c01a7336-20bc5ae2a1cmr7022275ad.58.1727808383452; Tue, 01 Oct 2024 11:46:23 -0700 (PDT) Received: from ryzen.lan ([2601:644:8200:dab8::a86]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20b37e357absm72278965ad.190.2024.10.01.11.46.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Oct 2024 11:46:23 -0700 (PDT) From: Rosen Penev To: netdev@vger.kernel.org Cc: andrew@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux-kernel@vger.kernel.org, olek2@wp.pl, shannon.nelson@amd.com Subject: [PATCHv2 net-next 10/10] net: lantiq_etop: return by register_netdev Date: Tue, 1 Oct 2024 11:46:07 -0700 Message-ID: <20241001184607.193461-11-rosenp@gmail.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241001184607.193461-1-rosenp@gmail.com> References: <20241001184607.193461-1-rosenp@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Simpler to do so. The error is not handled anyways. Signed-off-by: Rosen Penev --- drivers/net/ethernet/lantiq_etop.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/net/ethernet/lantiq_etop.c b/drivers/net/ethernet/lant= iq_etop.c index 355b96ecc5ec..cc5b94bc30b9 100644 --- a/drivers/net/ethernet/lantiq_etop.c +++ b/drivers/net/ethernet/lantiq_etop.c @@ -661,12 +661,8 @@ ltq_etop_probe(struct platform_device *pdev) priv->ch[i].netdev =3D dev; } =20 - err =3D devm_register_netdev(&pdev->dev, dev); - if (err) - return err; - platform_set_drvdata(pdev, dev); - return 0; + return devm_register_netdev(&pdev->dev, dev); } =20 static void ltq_etop_remove(struct platform_device *pdev) --=20 2.46.2