Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1456421 > unrolled thread
| Started by | Sandeep Jain <Sandeep_Jain@mentor.com> |
|---|---|
| First post | 2016-08-04 16:20 +0200 |
| Last post | 2016-08-05 14:20 +0200 |
| Articles | 4 — 4 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH v1 2/2] mtd: Add hooks to call get and put on mtd devices. Sandeep Jain <Sandeep_Jain@mentor.com> - 2016-08-04 16:20 +0200
Re: [PATCH v1 2/2] mtd: Add hooks to call get and put on mtd devices. Richard Weinberger <richard.weinberger@gmail.com> - 2016-08-04 19:40 +0200
Re: [PATCH v1 2/2] mtd: Add hooks to call get and put on mtd devices. "Baxter, Jim" <jim_baxter@mentor.com> - 2016-08-05 14:00 +0200
Re: [PATCH v1 2/2] mtd: Add hooks to call get and put on mtd devices. Richard Weinberger <richard@nod.at> - 2016-08-05 14:20 +0200
| From | Sandeep Jain <Sandeep_Jain@mentor.com> |
|---|---|
| Date | 2016-08-04 16:20 +0200 |
| Subject | [PATCH v1 2/2] mtd: Add hooks to call get and put on mtd devices. |
| Message-ID | <s2rF7-1SU-5@gated-at.bofh.it> |
From: Jim Baxter <jim_baxter@mentor.com>
Add hooks to mtdpart to call _get_device and _put_device,
this allows the mtd devices to perform internal
reference counting if required.
Signed-off-by: Jim Baxter <jim_baxter@mentor.com>
Signed-off-by: Sandeep Jain <Sandeep_Jain@mentor.com>
---
drivers/mtd/mtdpart.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c
index 1f13e32..adbb1fd 100644
--- a/drivers/mtd/mtdpart.c
+++ b/drivers/mtd/mtdpart.c
@@ -338,6 +338,20 @@ static const struct mtd_ooblayout_ops part_ooblayout_ops = {
.free = part_ooblayout_free,
};
+static int part_get_device(struct mtd_info *mtd)
+{
+ struct mtd_part *part = mtd_to_part(mtd);
+
+ return part->master->_get_device(part->master);
+}
+
+static void part_put_device(struct mtd_info *mtd)
+{
+ struct mtd_part *part = mtd_to_part(mtd);
+
+ part->master->_put_device(part->master);
+}
+
static inline void free_partition(struct mtd_part *p)
{
kfree(p->mtd.name);
@@ -463,6 +477,10 @@ static struct mtd_part *allocate_partition(struct mtd_info *master,
slave->mtd._block_isbad = part_block_isbad;
if (master->_block_markbad)
slave->mtd._block_markbad = part_block_markbad;
+ if (master->_get_device)
+ slave->mtd._get_device = part_get_device;
+ if (master->_put_device)
+ slave->mtd._put_device = part_put_device;
slave->mtd._erase = part_erase;
slave->master = master;
slave->offset = part->offset;
--
1.7.9.5
[toc] | [next] | [standalone]
| From | Richard Weinberger <richard.weinberger@gmail.com> |
|---|---|
| Date | 2016-08-04 19:40 +0200 |
| Message-ID | <s2uMG-45c-15@gated-at.bofh.it> |
| In reply to | #1456421 |
Hi!
On Thu, Aug 4, 2016 at 4:16 PM, Sandeep Jain <Sandeep_Jain@mentor.com> wrote:
> From: Jim Baxter <jim_baxter@mentor.com>
>
> Add hooks to mtdpart to call _get_device and _put_device,
> this allows the mtd devices to perform internal
> reference counting if required.
>
> Signed-off-by: Jim Baxter <jim_baxter@mentor.com>
> Signed-off-by: Sandeep Jain <Sandeep_Jain@mentor.com>
I sent the same patch some time ago:
https://patchwork.ozlabs.org/patch/644422/
> ---
> drivers/mtd/mtdpart.c | 18 ++++++++++++++++++
> 1 file changed, 18 insertions(+)
>
> diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c
> index 1f13e32..adbb1fd 100644
> --- a/drivers/mtd/mtdpart.c
> +++ b/drivers/mtd/mtdpart.c
> @@ -338,6 +338,20 @@ static const struct mtd_ooblayout_ops part_ooblayout_ops = {
> .free = part_ooblayout_free,
> };
>
> +static int part_get_device(struct mtd_info *mtd)
> +{
> + struct mtd_part *part = mtd_to_part(mtd);
> +
> + return part->master->_get_device(part->master);
> +}
> +
> +static void part_put_device(struct mtd_info *mtd)
> +{
> + struct mtd_part *part = mtd_to_part(mtd);
> +
> + part->master->_put_device(part->master);
> +}
> +
> static inline void free_partition(struct mtd_part *p)
> {
> kfree(p->mtd.name);
> @@ -463,6 +477,10 @@ static struct mtd_part *allocate_partition(struct mtd_info *master,
> slave->mtd._block_isbad = part_block_isbad;
> if (master->_block_markbad)
> slave->mtd._block_markbad = part_block_markbad;
> + if (master->_get_device)
> + slave->mtd._get_device = part_get_device;
> + if (master->_put_device)
> + slave->mtd._put_device = part_put_device;
> slave->mtd._erase = part_erase;
> slave->master = master;
> slave->offset = part->offset;
> --
> 1.7.9.5
>
>
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/
--
Thanks,
//richard
[toc] | [prev] | [next] | [standalone]
| From | "Baxter, Jim" <jim_baxter@mentor.com> |
|---|---|
| Date | 2016-08-05 14:00 +0200 |
| Message-ID | <s2LXc-72j-15@gated-at.bofh.it> |
| In reply to | #1456608 |
> Hi! > > On Thu, Aug 4, 2016 at 4:16 PM, Sandeep Jain <Sandeep_Jain@mentor.com> wrote: >> From: Jim Baxter <jim_baxter@mentor.com> >> >> Add hooks to mtdpart to call _get_device and _put_device, >> this allows the mtd devices to perform internal >> reference counting if required. >> >> Signed-off-by: Jim Baxter <jim_baxter@mentor.com> >> Signed-off-by: Sandeep Jain <Sandeep_Jain@mentor.com> > > I sent the same patch some time ago: > https://patchwork.ozlabs.org/patch/644422/ > Hi Richard, Thank you for letting us know. Thanks, Jim
[toc] | [prev] | [next] | [standalone]
| From | Richard Weinberger <richard@nod.at> |
|---|---|
| Date | 2016-08-05 14:20 +0200 |
| Message-ID | <s2Mgy-7oy-13@gated-at.bofh.it> |
| In reply to | #1457051 |
Am 05.08.2016 um 13:54 schrieb Baxter, Jim: >> On Thu, Aug 4, 2016 at 4:16 PM, Sandeep Jain <Sandeep_Jain@mentor.com> wrote: >>> From: Jim Baxter <jim_baxter@mentor.com> >>> >>> Add hooks to mtdpart to call _get_device and _put_device, >>> this allows the mtd devices to perform internal >>> reference counting if required. >>> >>> Signed-off-by: Jim Baxter <jim_baxter@mentor.com> >>> Signed-off-by: Sandeep Jain <Sandeep_Jain@mentor.com> >> >> I sent the same patch some time ago: >> https://patchwork.ozlabs.org/patch/644422/ Brian, can you please pickup my patch for 4.8-rcX? The patch fixes a real problem and another patch from Mentor folks depends on it. Thanks, //richard
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web