diff mbox

hw_random: Include device.h instead of declaring struct device

Message ID 20171026134208.31368-1-prasannatsmkumar@gmail.com (mailing list archive)
State Rejected
Delegated to: Herbert Xu
Headers show

Commit Message

PrasannaKumar Muralidharan Oct. 26, 2017, 1:42 p.m. UTC
Include linux/device.h instead of declaring struct device.

Signed-off-by: PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com>
---
 include/linux/hw_random.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Herbert Xu Oct. 30, 2017, 6:52 a.m. UTC | #1
On Thu, Oct 26, 2017 at 07:12:08PM +0530, PrasannaKumar Muralidharan wrote:
> Include linux/device.h instead of declaring struct device.
> 
> Signed-off-by: PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com>

Nack.  We should not include a header file when a simple forward
declaration is enough.
PrasannaKumar Muralidharan Oct. 30, 2017, 1 p.m. UTC | #2
Hi Herbert,

On 30 October 2017 at 12:22, Herbert Xu <herbert@gondor.apana.org.au> wrote:
> On Thu, Oct 26, 2017 at 07:12:08PM +0530, PrasannaKumar Muralidharan wrote:
>> Include linux/device.h instead of declaring struct device.
>>
>> Signed-off-by: PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com>
>
> Nack.  We should not include a header file when a simple forward
> declaration is enough.

No issues.

Regards,
PrasannaKumar
diff mbox

Patch

diff --git a/include/linux/hw_random.h b/include/linux/hw_random.h
index bee0827..2ec9af7 100644
--- a/include/linux/hw_random.h
+++ b/include/linux/hw_random.h
@@ -13,6 +13,7 @@ 
 #define LINUX_HWRANDOM_H_
 
 #include <linux/completion.h>
+#include <linux/device.h>
 #include <linux/types.h>
 #include <linux/list.h>
 #include <linux/kref.h>
@@ -51,8 +52,6 @@  struct hwrng {
 	struct completion cleanup_done;
 };
 
-struct device;
-
 /** Register a new Hardware Random Number Generator driver. */
 extern int hwrng_register(struct hwrng *rng);
 extern int devm_hwrng_register(struct device *dev, struct hwrng *rng);