Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1743081

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

From Joe Perches <joe@perches.com>
Newsgroups linux.kernel
Subject Re: [PATCH 2/4] staging: ccree: simplify access to struct device
Date 2017-10-02 12:10 +0200
Message-ID <uw5PI-60g-7@gated-at.bofh.it> (permalink)
References <uw4TD-5rr-3@gated-at.bofh.it> <uw4TE-5rr-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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;
}

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 0/4] staging: ccree: logging related coding style fixes Gilad Ben-Yossef <gilad@benyossef.com> - 2017-10-02 11:10 +0200
  [PATCH 4/4] staging: ccree: simplify OOM handling Gilad Ben-Yossef <gilad@benyossef.com> - 2017-10-02 11:10 +0200
  [PATCH 1/4] staging: ccree: remove sysfs if of deleted code Gilad Ben-Yossef <gilad@benyossef.com> - 2017-10-02 11:10 +0200
  [PATCH 2/4] staging: ccree: simplify access to struct device Gilad Ben-Yossef <gilad@benyossef.com> - 2017-10-02 11:10 +0200
    Re: [PATCH 2/4] staging: ccree: simplify access to struct device Joe Perches <joe@perches.com> - 2017-10-02 12:10 +0200

csiph-web