forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-04 1543e317f1da31b75942316931e8f491a8920811
kernel/drivers/net/ethernet/marvell/mvneta_bm.c
....@@ -190,7 +190,7 @@
190190 SKB_DATA_ALIGN(sizeof(struct skb_shared_info));
191191 hwbm_pool->construct = mvneta_bm_construct;
192192 hwbm_pool->priv = new_pool;
193
- spin_lock_init(&hwbm_pool->lock);
193
+ mutex_init(&hwbm_pool->buf_lock);
194194
195195 /* Create new pool */
196196 err = mvneta_bm_pool_create(priv, new_pool);
....@@ -201,7 +201,7 @@
201201 }
202202
203203 /* Allocate buffers for this pool */
204
- num = hwbm_pool_add(hwbm_pool, hwbm_pool->size, GFP_ATOMIC);
204
+ num = hwbm_pool_add(hwbm_pool, hwbm_pool->size);
205205 if (num != hwbm_pool->size) {
206206 WARN(1, "pool %d: %d of %d allocated\n",
207207 new_pool->id, num, hwbm_pool->size);
....@@ -411,15 +411,13 @@
411411 {
412412 struct device_node *dn = pdev->dev.of_node;
413413 struct mvneta_bm *priv;
414
- struct resource *res;
415414 int err;
416415
417416 priv = devm_kzalloc(&pdev->dev, sizeof(struct mvneta_bm), GFP_KERNEL);
418417 if (!priv)
419418 return -ENOMEM;
420419
421
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
422
- priv->reg_base = devm_ioremap_resource(&pdev->dev, res);
420
+ priv->reg_base = devm_platform_ioremap_resource(pdev, 0);
423421 if (IS_ERR(priv->reg_base))
424422 return PTR_ERR(priv->reg_base);
425423