| .. | .. |
|---|
| 190 | 190 | SKB_DATA_ALIGN(sizeof(struct skb_shared_info)); |
|---|
| 191 | 191 | hwbm_pool->construct = mvneta_bm_construct; |
|---|
| 192 | 192 | hwbm_pool->priv = new_pool; |
|---|
| 193 | | - spin_lock_init(&hwbm_pool->lock); |
|---|
| 193 | + mutex_init(&hwbm_pool->buf_lock); |
|---|
| 194 | 194 | |
|---|
| 195 | 195 | /* Create new pool */ |
|---|
| 196 | 196 | err = mvneta_bm_pool_create(priv, new_pool); |
|---|
| .. | .. |
|---|
| 201 | 201 | } |
|---|
| 202 | 202 | |
|---|
| 203 | 203 | /* 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); |
|---|
| 205 | 205 | if (num != hwbm_pool->size) { |
|---|
| 206 | 206 | WARN(1, "pool %d: %d of %d allocated\n", |
|---|
| 207 | 207 | new_pool->id, num, hwbm_pool->size); |
|---|
| .. | .. |
|---|
| 411 | 411 | { |
|---|
| 412 | 412 | struct device_node *dn = pdev->dev.of_node; |
|---|
| 413 | 413 | struct mvneta_bm *priv; |
|---|
| 414 | | - struct resource *res; |
|---|
| 415 | 414 | int err; |
|---|
| 416 | 415 | |
|---|
| 417 | 416 | priv = devm_kzalloc(&pdev->dev, sizeof(struct mvneta_bm), GFP_KERNEL); |
|---|
| 418 | 417 | if (!priv) |
|---|
| 419 | 418 | return -ENOMEM; |
|---|
| 420 | 419 | |
|---|
| 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); |
|---|
| 423 | 421 | if (IS_ERR(priv->reg_base)) |
|---|
| 424 | 422 | return PTR_ERR(priv->reg_base); |
|---|
| 425 | 423 | |
|---|