LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Brian Norris <computersforpeace@gmail.com>
Cc: Linux Next Mailing List <linux-next@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Boris Brezillon <bbrezillon@kernel.org>,
	Miquel Raynal <miquel.raynal@bootlin.com>
Subject: linux-next: manual merge of the mtd tree with Linus' tree
Date: Tue, 29 Jan 2019 11:17:00 +1100	[thread overview]
Message-ID: <20190129111700.7d50e369@canb.auug.org.au> (raw)

[-- Attachment #1: Type: text/plain, Size: 4332 bytes --]

Hi all,

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

  drivers/mtd/mtdpart.c

between commit:

  2b6f0090a333 ("mtd: Check add_mtd_device() ret code")

from Linus' tree and commit:

  2c24c9af0f38 ("mtd: rework partitions handling")

from the mtd 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.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/mtd/mtdpart.c
index 60104e1079c5,089095b3c50d..000000000000
--- a/drivers/mtd/mtdpart.c
+++ b/drivers/mtd/mtdpart.c
@@@ -610,30 -265,18 +265,30 @@@ int mtd_add_partition(struct mtd_info *
  	part.size = length;
  	part.offset = offset;
  
- 	new = allocate_partition(parent, &part, -1, offset);
- 	if (IS_ERR(new))
- 		return PTR_ERR(new);
+ 	child = allocate_partition(parent, &part, -1, offset);
+ 	if (IS_ERR(child))
+ 		return PTR_ERR(child);
  
- 	mutex_lock(&mtd_partitions_mutex);
- 	list_add(&new->list, &mtd_partitions);
- 	mutex_unlock(&mtd_partitions_mutex);
+ 	mutex_lock(&master->props.master.partitions_lock);
+ 	list_add_tail(&child->props.part.node, &parent->partitions);
+ 	mutex_unlock(&master->props.master.partitions_lock);
  
- 	ret = add_mtd_device(&new->mtd);
 -	add_mtd_device(child);
++	ret = add_mtd_device(child);
 +	if (ret)
 +		goto err_remove_part;
  
- 	mtd_add_partition_attrs(new);
+ 	mtd_add_partition_attrs(child);
  
 +	return 0;
 +
 +err_remove_part:
- 	mutex_lock(&mtd_partitions_mutex);
- 	list_del(&new->list);
- 	mutex_unlock(&mtd_partitions_mutex);
++	mutex_lock(&master->props.master.partitions_lock);
++	list_del(&child->props.part.node);
++	mutex_unlock(&master->props.master.partitions_lock);
 +
- 	free_partition(new);
++	free_partition(child);
 +	pr_info("%s:%i\n", __func__, __LINE__);
 +
  	return ret;
  }
  EXPORT_SYMBOL_GPL(mtd_add_partition);
@@@ -722,46 -386,33 +398,47 @@@ int add_mtd_partitions(struct mtd_info 
  		       const struct mtd_partition *parts,
  		       int nbparts)
  {
- 	struct mtd_part *slave;
+ 	struct mtd_info *child, *master = mtd_get_master(parent);
  	uint64_t cur_offset = 0;
 -	int i;
 +	int i, ret;
  
- 	printk(KERN_NOTICE "Creating %d MTD partitions on \"%s\":\n", nbparts, master->name);
+ 	printk(KERN_NOTICE "Creating %d MTD partitions on \"%s\":\n",
+ 	       nbparts, parent->name);
  
  	for (i = 0; i < nbparts; i++) {
- 		slave = allocate_partition(master, parts + i, i, cur_offset);
- 		if (IS_ERR(slave)) {
- 			ret = PTR_ERR(slave);
+ 		child = allocate_partition(parent, parts + i, i, cur_offset);
+ 		if (IS_ERR(child)) {
 -			del_mtd_partitions(parent);
 -			return PTR_ERR(child);
++			ret = PTR_ERR(child);
 +			goto err_del_partitions;
  		}
  
- 		mutex_lock(&mtd_partitions_mutex);
- 		list_add(&slave->list, &mtd_partitions);
- 		mutex_unlock(&mtd_partitions_mutex);
+ 		mutex_lock(&master->props.master.partitions_lock);
+ 		list_add_tail(&child->props.part.node, &parent->partitions);
+ 		mutex_unlock(&master->props.master.partitions_lock);
  
 -		add_mtd_device(child);
 +		ret = add_mtd_device(child);
 +		if (ret) {
- 			mutex_lock(&mtd_partitions_mutex);
- 			list_del(&slave->list);
- 			mutex_unlock(&mtd_partitions_mutex);
++			mutex_lock(&master->props.master.partitions_lock);
++			list_del(&child->props.part.node);
++			mutex_unlock(&master->props.master.partitions_lock);
 +
- 			free_partition(slave);
++			free_partition(child);
 +			goto err_del_partitions;
 +		}
 +
- 		mtd_add_partition_attrs(slave);
+ 		mtd_add_partition_attrs(child);
  		/* Look for subpartitions */
- 		parse_mtd_partitions(&slave->mtd, parts[i].types, NULL);
+ 		parse_mtd_partitions(child, parts[i].types, NULL);
  
- 		cur_offset = slave->offset + slave->mtd.size;
+ 		cur_offset = child->props.part.offset + child->size;
  	}
  
  	return 0;
 +
 +err_del_partitions:
- 	del_mtd_partitions(master);
++	del_mtd_partitions(parent);
 +
 +	return ret;
  }
  
  static DEFINE_SPINLOCK(part_parser_lock);

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

             reply	other threads:[~2019-01-29  0:17 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-29  0:17 Stephen Rothwell [this message]
2019-01-29 14:12 ` Boris Brezillon
  -- strict thread matches above, loose matches on Subject: below --
2021-08-17  4:49 Stephen Rothwell
2021-08-17  8:15 ` Sean Young
2021-08-17  8:41   ` Miquel Raynal
2011-05-27  4:00 Stephen Rothwell
2011-05-27  7:47 ` Artem Bityutskiy
2011-05-27  4:00 Stephen Rothwell
2011-05-27  7:43 ` Artem Bityutskiy
2010-10-26  0:32 Stephen Rothwell
2010-08-07  3:37 Stephen Rothwell
2010-04-29  2:58 Stephen Rothwell
2009-06-01  4:00 Stephen Rothwell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190129111700.7d50e369@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=bbrezillon@kernel.org \
    --cc=computersforpeace@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=miquel.raynal@bootlin.com \
    --subject='Re: linux-next: manual merge of the mtd tree with Linus'\'' tree' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).