From: Nikhil Badola <nikhil.badola@freescale.com>
To: <linuxppc-dev@lists.ozlabs.org>
Cc: Nikhil Badola <nikhil.badola@freescale.com>
Subject: [PATCH] powerpc : dma-mapping : Check null condition for dev->archdata.dma_ops
Date: Fri, 18 Jul 2014 15:34:52 +0530 [thread overview]
Message-ID: <1405677892-7201-1-git-send-email-nikhil.badola@freescale.com> (raw)
Modifies get_dma_ops() implementation on ppc arch to check null condition
for dev->archdata.dma_ops; returns common dma_direct_ops structure in
case its NULL
Signed-off-by: Nikhil Badola <nikhil.badola@freescale.com>
---
arch/powerpc/include/asm/dma-mapping.h | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/include/asm/dma-mapping.h b/arch/powerpc/include/asm/dma-mapping.h
index 150866b..d73bae8 100644
--- a/arch/powerpc/include/asm/dma-mapping.h
+++ b/arch/powerpc/include/asm/dma-mapping.h
@@ -86,10 +86,12 @@ static inline struct dma_map_ops *get_dma_ops(struct device *dev)
*/
if (unlikely(dev == NULL))
return NULL;
-
- return dev->archdata.dma_ops;
+ if (dev->archdata.dma_ops)
+ return dev->archdata.dma_ops;
+ return &dma_direct_ops;
}
+
static inline void set_dma_ops(struct device *dev, struct dma_map_ops *ops)
{
dev->archdata.dma_ops = ops;
--
1.7.11.7
next reply other threads:[~2014-07-18 10:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-18 10:04 Nikhil Badola [this message]
2014-07-18 13:51 ` [PATCH] powerpc : dma-mapping : Check null condition for dev->archdata.dma_ops Denis Kirjanov
2014-07-21 9:47 ` nikhil.badola
2014-09-03 22:56 ` Scott Wood
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=1405677892-7201-1-git-send-email-nikhil.badola@freescale.com \
--to=nikhil.badola@freescale.com \
--cc=linuxppc-dev@lists.ozlabs.org \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).