static inline u16 r_tpu_read(struct r_tpu_priv *p, int reg_nr)
{
- struct led_renesas_tpu_config *cfg = p->pdev->dev.platform_data;
+ struct led_renesas_tpu_config *cfg = dev_get_platdata(&p->pdev->dev);
void __iomem *base = p->mapbase;
unsigned long offs = reg_nr << 2;
static inline void r_tpu_write(struct r_tpu_priv *p, int reg_nr, u16 value)
{
- struct led_renesas_tpu_config *cfg = p->pdev->dev.platform_data;
+ struct led_renesas_tpu_config *cfg = dev_get_platdata(&p->pdev->dev);
void __iomem *base = p->mapbase;
unsigned long offs = reg_nr << 2;
static void r_tpu_start_stop_ch(struct r_tpu_priv *p, int start)
{
- struct led_renesas_tpu_config *cfg = p->pdev->dev.platform_data;
+ struct led_renesas_tpu_config *cfg = dev_get_platdata(&p->pdev->dev);
unsigned long flags;
u16 value;
static int r_tpu_enable(struct r_tpu_priv *p, enum led_brightness brightness)
{
- struct led_renesas_tpu_config *cfg = p->pdev->dev.platform_data;
+ struct led_renesas_tpu_config *cfg = dev_get_platdata(&p->pdev->dev);
int prescaler[] = { 1, 4, 16, 64 };
int k, ret;
unsigned long rate, tmp;
static void r_tpu_set_pin(struct r_tpu_priv *p, enum r_tpu_pin new_state,
enum led_brightness brightness)
{
- struct led_renesas_tpu_config *cfg = p->pdev->dev.platform_data;
+ struct led_renesas_tpu_config *cfg = dev_get_platdata(&p->pdev->dev);
if (p->pin_state == new_state) {
if (p->pin_state == R_TPU_PIN_GPIO)
static int r_tpu_probe(struct platform_device *pdev)
{
- struct led_renesas_tpu_config *cfg = pdev->dev.platform_data;
+ struct led_renesas_tpu_config *cfg = dev_get_platdata(&pdev->dev);
struct r_tpu_priv *p;
struct resource *res;
int ret;