diff mbox

[RFC,V2,2/2] sdhci: Move sdhci.h to include/

Message ID 1441634319-23268-2-git-send-email-saipava@xilinx.com
State New
Headers show

Commit Message

Sai Pavan Boddu Sept. 7, 2015, 1:58 p.m. UTC
Move sdhci.h to include/hw/sd/. Which makes easy creation of device
using object_initialize.

Signed-off-by: Sai Pavan Boddu <saipava@xilinx.com>
---
Changes for V2:
   Create new area in includes for sd. And move sdhci.h to same.
---
 hw/sd/sdhci.c                 | 2 +-
 {hw => include/hw}/sd/sdhci.h | 0
 2 files changed, 1 insertion(+), 1 deletion(-)
 rename {hw => include/hw}/sd/sdhci.h (100%)

Comments

Stefan Hajnoczi Sept. 9, 2015, 9:37 a.m. UTC | #1
On Mon, Sep 07, 2015 at 07:28:39PM +0530, Sai Pavan Boddu wrote:
> Move sdhci.h to include/hw/sd/. Which makes easy creation of device
> using object_initialize.
> 
> Signed-off-by: Sai Pavan Boddu <saipava@xilinx.com>
> ---
> Changes for V2:
>    Create new area in includes for sd. And move sdhci.h to same.
> ---
>  hw/sd/sdhci.c                 | 2 +-
>  {hw => include/hw}/sd/sdhci.h | 0
>  2 files changed, 1 insertion(+), 1 deletion(-)
>  rename {hw => include/hw}/sd/sdhci.h (100%)

Please keep hardware constants and any other device emulation internals
in hw/sd/.  The header files in include/ should only contain that
"public" APIs that other parts of QEMU consume.

I think the declarations that need to be in include/ are:
1. typedef struct SDHCIState
2. TYPE_PCI_SDHCI and PCI_SDHCI()
3. TYPE_SYSBUS_SDHCI and SYSBUS_SDHCI()

The other declarations are internals that should be kept in hw/sd/.

This way there is a clear public API and internals (used by SD emulation
code).
Sai Pavan Boddu Sept. 9, 2015, 9:43 a.m. UTC | #2
Hi Stefan,

> -----Original Message-----
> From: Stefan Hajnoczi [mailto:stefanha@gmail.com]
> Sent: Wednesday, September 09, 2015 3:08 PM
> To: Sai Pavan Boddu
> Cc: qemu-devel@nongnu.org; crosthwaitepeter@gmail.com;
> eblake@redhat.com; peter.maydell@linaro.org; Sai Pavan Boddu; Edgar
> Iglesias; Alistair Francis
> Subject: Re: [Qemu-devel] [RFC V2 2/2] sdhci: Move sdhci.h to include/
> 
> On Mon, Sep 07, 2015 at 07:28:39PM +0530, Sai Pavan Boddu wrote:
> > Move sdhci.h to include/hw/sd/. Which makes easy creation of device
> > using object_initialize.
> >
> > Signed-off-by: Sai Pavan Boddu <saipava@xilinx.com>
> > ---
> > Changes for V2:
> >    Create new area in includes for sd. And move sdhci.h to same.
> > ---
> >  hw/sd/sdhci.c                 | 2 +-
> >  {hw => include/hw}/sd/sdhci.h | 0
> >  2 files changed, 1 insertion(+), 1 deletion(-)
> >  rename {hw => include/hw}/sd/sdhci.h (100%)
> 
> Please keep hardware constants and any other device emulation internals
> in hw/sd/.  The header files in include/ should only contain that
> "public" APIs that other parts of QEMU consume.
> 
> I think the declarations that need to be in include/ are:
> 1. typedef struct SDHCIState
> 2. TYPE_PCI_SDHCI and PCI_SDHCI()
> 3. TYPE_SYSBUS_SDHCI and SYSBUS_SDHCI()
[Sai Pavan ] Ok sounds fair, So I will try to send out patches splitting the header into two. And moving the public content into include/.

Regards,
Sai Pavan
> 
> The other declarations are internals that should be kept in hw/sd/.
> 
> This way there is a clear public API and internals (used by SD emulation
> code).
diff mbox

Patch

diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c
index e63367b..811e5b0 100644
--- a/hw/sd/sdhci.c
+++ b/hw/sd/sdhci.c
@@ -29,7 +29,7 @@ 
 #include "qemu/timer.h"
 #include "qemu/bitops.h"
 
-#include "sdhci.h"
+#include "hw/sd/sdhci.h"
 
 /* host controller debug messages */
 #ifndef SDHC_DEBUG
diff --git a/hw/sd/sdhci.h b/include/hw/sd/sdhci.h
similarity index 100%
rename from hw/sd/sdhci.h
rename to include/hw/sd/sdhci.h