Skip to contentSkip to conversation

linux-next: manual merge of the mfd tree with the origin tree

PATCH Mark Brown 2 participants 4 messages Nov 16 – Nov 17

Subsystems (3)
lore
Share & tools
lore

Mark Brown

author maintainer
#0 lore raw

Hi all,

Today's linux-next merge of the mfd tree got a conflict in:

drivers/mfd/nct6694.c

between commit:

4dd10fbbeb9c3 ("treewide: Convert devm_kmalloc() family to the devm_kmalloc_obj() family")

from the origin tree and commit:

962b44ae8126d ("mfd: nct6694: Allocate USB DMA buffers with kzalloc_obj()")

from the mfd tree.

I fixed it up (see below) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts.

drivers/mfd/nct6694.c +0 -0
diff --combined drivers/mfd/nct6694.c
index dabd83b9d455c,40a29f8e0ff61..0000000000000
@@@ -201,6 -201,7 +201,7 @@@ static void usb_int_callback(struct ur
  		break;
  	case -ECONNRESET:
  	case -ENOENT:
+ 	case -EPIPE:
  	case -ESHUTDOWN:
  		return;
  	default:
@@@ -280,21 -281,25 +281,25 @@@ static int nct6694_usb_probe(struct usb
  	struct nct6694 *nct6694;
  	int ret;
  
 -	nct6694 = devm_kzalloc(dev, sizeof(*nct6694), GFP_KERNEL);
 +	nct6694 = devm_kzalloc_obj(dev, *nct6694);
  	if (!nct6694)
  		return -ENOMEM;
  
- 	nct6694->usb_msg = devm_kzalloc_obj(dev, union nct6694_usb_msg);
+ 	nct6694->usb_msg = kzalloc_obj(*nct6694->usb_msg);
  	if (!nct6694->usb_msg)
  		return -ENOMEM;
  
- 	nct6694->int_buffer = devm_kzalloc_obj(dev, *nct6694->int_buffer);
- 	if (!nct6694->int_buffer)
- 		return -ENOMEM;
+ 	nct6694->int_buffer = kzalloc_obj(*nct6694->int_buffer);
+ 	if (!nct6694->int_buffer) {
+ 		ret = -ENOMEM;
+ 		goto err_usb_msg;
+ 	}
  
  	nct6694->int_in_urb = usb_alloc_urb(0, GFP_KERNEL);
- 	if (!nct6694->int_in_urb)
- 		return -ENOMEM;
+ 	if (!nct6694->int_in_urb) {
+ 		ret = -ENOMEM;
+ 		goto err_int_buffer;
+ 	}
  
  	nct6694->domain = irq_domain_create_simple(NULL, NCT6694_NR_IRQS, 0,
  						   &nct6694_irq_domain_ops,
@@@ -352,6 -357,10 +357,10 @@@ err_ida
  	irq_domain_remove(nct6694->domain);
  err_urb:
  	usb_free_urb(nct6694->int_in_urb);
+ err_int_buffer:
+ 	kfree(nct6694->int_buffer);
+ err_usb_msg:
+ 	kfree(nct6694->usb_msg);
  	return ret;
  }
  
@@@ -367,6 -376,8 +376,8 @@@ static void nct6694_usb_disconnect(stru
  	ida_destroy(&nct6694->gpio_ida);
  	irq_domain_remove(nct6694->domain);
  	usb_free_urb(nct6694->int_in_urb);
+ 	kfree(nct6694->int_buffer);
+ 	kfree(nct6694->usb_msg);
  }
  
  static const struct usb_device_id nct6694_ids[] = {
maintainer
#1 lore raw

Kees, et al.,

Quoted 7 lines

Today's linux-next merge of the mfd tree got a conflict in:

drivers/mfd/nct6694.c

between commit:

4dd10fbbeb9c3 ("treewide: Convert devm_kmalloc() family to the devm_kmalloc_obj() family")

Is there a branch / tag that I can pull this in from?

Quoted 78 lines

from the origin tree and commit:

962b44ae8126d ("mfd: nct6694: Allocate USB DMA buffers with kzalloc_obj()")

from the mfd tree.

I fixed it up (see below) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts.

drivers/mfd/nct6694.c +17 -6
diff --combined drivers/mfd/nct6694.c
index dabd83b9d455c,40a29f8e0ff61..0000000000000
@@@ -201,6 -201,7 +201,7 @@@ static void usb_int_callback(struct ur
  		break;
  	case -ECONNRESET:
  	case -ENOENT:
+ 	case -EPIPE:
  	case -ESHUTDOWN:
  		return;
  	default:
@@@ -280,21 -281,25 +281,25 @@@ static int nct6694_usb_probe(struct usb
  	struct nct6694 *nct6694;
  	int ret;
 
 -	nct6694 = devm_kzalloc(dev, sizeof(*nct6694), GFP_KERNEL);
 +	nct6694 = devm_kzalloc_obj(dev, *nct6694);
  	if (!nct6694)
  		return -ENOMEM;
 
- 	nct6694->usb_msg = devm_kzalloc_obj(dev, union nct6694_usb_msg);
+ 	nct6694->usb_msg = kzalloc_obj(*nct6694->usb_msg);
  	if (!nct6694->usb_msg)
  		return -ENOMEM;
 
- 	nct6694->int_buffer = devm_kzalloc_obj(dev, *nct6694->int_buffer);
- 	if (!nct6694->int_buffer)
- 		return -ENOMEM;
+ 	nct6694->int_buffer = kzalloc_obj(*nct6694->int_buffer);
+ 	if (!nct6694->int_buffer) {
+ 		ret = -ENOMEM;
+ 		goto err_usb_msg;
+ 	}
 
  	nct6694->int_in_urb = usb_alloc_urb(0, GFP_KERNEL);
- 	if (!nct6694->int_in_urb)
- 		return -ENOMEM;
+ 	if (!nct6694->int_in_urb) {
+ 		ret = -ENOMEM;
+ 		goto err_int_buffer;
+ 	}
 
  	nct6694->domain = irq_domain_create_simple(NULL, NCT6694_NR_IRQS, 0,
  						   &nct6694_irq_domain_ops,
@@@ -352,6 -357,10 +357,10 @@@ err_ida
  	irq_domain_remove(nct6694->domain);
  err_urb:
  	usb_free_urb(nct6694->int_in_urb);
+ err_int_buffer:
+ 	kfree(nct6694->int_buffer);
+ err_usb_msg:
+ 	kfree(nct6694->usb_msg);
  	return ret;
  }
@@@ -367,6 -376,8 +376,8 @@@ static void nct6694_usb_disconnect(stru
  	ida_destroy(&nct6694->gpio_ida);
  	irq_domain_remove(nct6694->domain);
  	usb_free_urb(nct6694->int_in_urb);
+ 	kfree(nct6694->int_buffer);
+ 	kfree(nct6694->usb_msg);
  }
 
  static const struct usb_device_id nct6694_ids[] = {
Signature · 1 line
Lee Jones
author maintainer
#2 lore raw
Quoted 11 lines · Lee Jones

Kees, et al.,

Quoted 7 lines

Today's linux-next merge of the mfd tree got a conflict in:

drivers/mfd/nct6694.c

between commit:

4dd10fbbeb9c3 ("treewide: Convert devm_kmalloc() family to the devm_kmalloc_obj() family")

Is there a branch / tag that I can pull this in from?

It's been in mainline since -rc2.

maintainer
#3 lore raw
Quoted 7 lines · Mark Brown
Quoted 6 lines · Lee Jones

Kees, et al.,

Quoted 4 lines

Today's linux-next merge of the mfd tree got a conflict in:

drivers/mfd/nct6694.c

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

between commit:

4dd10fbbeb9c3 ("treewide: Convert devm_kmalloc() family to the devm_kmalloc_obj() family")

Is there a branch / tag that I can pull this in from?

It's been in mainline since -rc2.

Okay, I'll rebase. Thanks.

Signature · 1 line
Lee Jones