Re: [PATCH 2/4] staging: ccree: simplify access to struct device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2017-10-02 at 10:03 +0100, Gilad Ben-Yossef wrote:
> Introduce a DEV macro to retrieve struct device from private
> data structure in preparation to replacing custom logging
> macros with proper dev_dbg and friends which require struct
> device.
[]
> diff --git a/drivers/staging/ccree/ssi_driver.h b/drivers/staging/ccree/ssi_driver.h
[]
> @@ -103,6 +103,8 @@
>  #define SSI_LOG_DEBUG(format, ...) do {} while (0)
>  #endif
>  
> +#define DEV(drvdata) ((&(drvdata)->plat_dev->dev))

The name seems not particularly descriptive.
It seems a longer name would
not be too bad.

Perhaps

static inline struct device *drvdata_to_dev(struct ssi_drvdata *drvdata)
{
	return &drvdata->plat_dev->dev;
}

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux