Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drivers/video: fsl-diu-fb: rename "machine_data" to "data"

"machine_data" is too long and clunky, and the "machine" part doesn't make
much sense, anyway.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>

authored by

Timur Tabi and committed by
Florian Tobias Schandinat
b7795052 ff8c9107

+116 -120
+116 -120
drivers/video/fsl-diu-fb.c
··· 509 509 { 510 510 struct mfb_info *pmfbi, *cmfbi, *mfbi = info->par; 511 511 struct diu_ad *ad = mfbi->ad; 512 - struct fsl_diu_data *machine_data = mfbi->parent; 513 - struct diu __iomem *hw = machine_data->diu_reg; 512 + struct fsl_diu_data *data = mfbi->parent; 513 + struct diu __iomem *hw = data->diu_reg; 514 514 515 515 switch (mfbi->index) { 516 516 case PLANE0: ··· 518 518 wr_reg_wa(&hw->desc[0], ad->paddr); 519 519 break; 520 520 case PLANE1_AOI0: 521 - cmfbi = &machine_data->mfb[2]; 521 + cmfbi = &data->mfb[2]; 522 522 if (hw->desc[1] != ad->paddr) { /* AOI0 closed */ 523 523 if (cmfbi->count > 0) /* AOI1 open */ 524 524 ad->next_ad = ··· 529 529 } 530 530 break; 531 531 case PLANE2_AOI0: 532 - cmfbi = &machine_data->mfb[4]; 532 + cmfbi = &data->mfb[4]; 533 533 if (hw->desc[2] != ad->paddr) { /* AOI0 closed */ 534 534 if (cmfbi->count > 0) /* AOI1 open */ 535 535 ad->next_ad = ··· 540 540 } 541 541 break; 542 542 case PLANE1_AOI1: 543 - pmfbi = &machine_data->mfb[1]; 543 + pmfbi = &data->mfb[1]; 544 544 ad->next_ad = 0; 545 - if (hw->desc[1] == machine_data->dummy_ad.paddr) 545 + if (hw->desc[1] == data->dummy_ad.paddr) 546 546 wr_reg_wa(&hw->desc[1], ad->paddr); 547 547 else /* AOI0 open */ 548 548 pmfbi->ad->next_ad = cpu_to_le32(ad->paddr); 549 549 break; 550 550 case PLANE2_AOI1: 551 - pmfbi = &machine_data->mfb[3]; 551 + pmfbi = &data->mfb[3]; 552 552 ad->next_ad = 0; 553 - if (hw->desc[2] == machine_data->dummy_ad.paddr) 553 + if (hw->desc[2] == data->dummy_ad.paddr) 554 554 wr_reg_wa(&hw->desc[2], ad->paddr); 555 555 else /* AOI0 was open */ 556 556 pmfbi->ad->next_ad = cpu_to_le32(ad->paddr); ··· 562 562 { 563 563 struct mfb_info *pmfbi, *cmfbi, *mfbi = info->par; 564 564 struct diu_ad *ad = mfbi->ad; 565 - struct fsl_diu_data *machine_data = mfbi->parent; 566 - struct diu __iomem *hw = machine_data->diu_reg; 565 + struct fsl_diu_data *data = mfbi->parent; 566 + struct diu __iomem *hw = data->diu_reg; 567 567 568 568 switch (mfbi->index) { 569 569 case PLANE0: 570 - if (hw->desc[0] != machine_data->dummy_ad.paddr) 571 - wr_reg_wa(&hw->desc[0], machine_data->dummy_ad.paddr); 570 + if (hw->desc[0] != data->dummy_ad.paddr) 571 + wr_reg_wa(&hw->desc[0], data->dummy_ad.paddr); 572 572 break; 573 573 case PLANE1_AOI0: 574 - cmfbi = &machine_data->mfb[2]; 574 + cmfbi = &data->mfb[2]; 575 575 if (cmfbi->count > 0) /* AOI1 is open */ 576 576 wr_reg_wa(&hw->desc[1], cmfbi->ad->paddr); 577 577 /* move AOI1 to the first */ 578 578 else /* AOI1 was closed */ 579 - wr_reg_wa(&hw->desc[1], machine_data->dummy_ad.paddr); 579 + wr_reg_wa(&hw->desc[1], data->dummy_ad.paddr); 580 580 /* close AOI 0 */ 581 581 break; 582 582 case PLANE2_AOI0: 583 - cmfbi = &machine_data->mfb[4]; 583 + cmfbi = &data->mfb[4]; 584 584 if (cmfbi->count > 0) /* AOI1 is open */ 585 585 wr_reg_wa(&hw->desc[2], cmfbi->ad->paddr); 586 586 /* move AOI1 to the first */ 587 587 else /* AOI1 was closed */ 588 - wr_reg_wa(&hw->desc[2], machine_data->dummy_ad.paddr); 588 + wr_reg_wa(&hw->desc[2], data->dummy_ad.paddr); 589 589 /* close AOI 0 */ 590 590 break; 591 591 case PLANE1_AOI1: 592 - pmfbi = &machine_data->mfb[1]; 592 + pmfbi = &data->mfb[1]; 593 593 if (hw->desc[1] != ad->paddr) { 594 594 /* AOI1 is not the first in the chain */ 595 595 if (pmfbi->count > 0) 596 596 /* AOI0 is open, must be the first */ 597 597 pmfbi->ad->next_ad = 0; 598 598 } else /* AOI1 is the first in the chain */ 599 - wr_reg_wa(&hw->desc[1], machine_data->dummy_ad.paddr); 599 + wr_reg_wa(&hw->desc[1], data->dummy_ad.paddr); 600 600 /* close AOI 1 */ 601 601 break; 602 602 case PLANE2_AOI1: 603 - pmfbi = &machine_data->mfb[3]; 603 + pmfbi = &data->mfb[3]; 604 604 if (hw->desc[2] != ad->paddr) { 605 605 /* AOI1 is not the first in the chain */ 606 606 if (pmfbi->count > 0) 607 607 /* AOI0 is open, must be the first */ 608 608 pmfbi->ad->next_ad = 0; 609 609 } else /* AOI1 is the first in the chain */ 610 - wr_reg_wa(&hw->desc[2], machine_data->dummy_ad.paddr); 610 + wr_reg_wa(&hw->desc[2], data->dummy_ad.paddr); 611 611 /* close AOI 1 */ 612 612 break; 613 613 } ··· 616 616 static void enable_lcdc(struct fb_info *info) 617 617 { 618 618 struct mfb_info *mfbi = info->par; 619 - struct fsl_diu_data *machine_data = mfbi->parent; 620 - struct diu __iomem *hw = machine_data->diu_reg; 619 + struct fsl_diu_data *data = mfbi->parent; 620 + struct diu __iomem *hw = data->diu_reg; 621 621 622 - if (!machine_data->fb_enabled) { 622 + if (!data->fb_enabled) { 623 623 out_be32(&hw->diu_mode, MFB_MODE1); 624 - machine_data->fb_enabled++; 624 + data->fb_enabled++; 625 625 } 626 626 } 627 627 628 628 static void disable_lcdc(struct fb_info *info) 629 629 { 630 630 struct mfb_info *mfbi = info->par; 631 - struct fsl_diu_data *machine_data = mfbi->parent; 632 - struct diu __iomem *hw = machine_data->diu_reg; 631 + struct fsl_diu_data *data = mfbi->parent; 632 + struct diu __iomem *hw = data->diu_reg; 633 633 634 - if (machine_data->fb_enabled) { 634 + if (data->fb_enabled) { 635 635 out_be32(&hw->diu_mode, 0); 636 - machine_data->fb_enabled = 0; 636 + data->fb_enabled = 0; 637 637 } 638 638 } 639 639 ··· 641 641 struct fb_info *info) 642 642 { 643 643 struct mfb_info *lower_aoi_mfbi, *upper_aoi_mfbi, *mfbi = info->par; 644 - struct fsl_diu_data *machine_data = mfbi->parent; 644 + struct fsl_diu_data *data = mfbi->parent; 645 645 int available_height, upper_aoi_bottom; 646 646 enum mfb_index index = mfbi->index; 647 647 int lower_aoi_is_open, upper_aoi_is_open; 648 648 __u32 base_plane_width, base_plane_height, upper_aoi_height; 649 649 650 - base_plane_width = machine_data->fsl_diu_info[0].var.xres; 651 - base_plane_height = machine_data->fsl_diu_info[0].var.yres; 650 + base_plane_width = data->fsl_diu_info[0].var.xres; 651 + base_plane_height = data->fsl_diu_info[0].var.yres; 652 652 653 653 if (mfbi->x_aoi_d < 0) 654 654 mfbi->x_aoi_d = 0; ··· 663 663 break; 664 664 case PLANE1_AOI0: 665 665 case PLANE2_AOI0: 666 - lower_aoi_mfbi = machine_data->fsl_diu_info[index+1].par; 666 + lower_aoi_mfbi = data->fsl_diu_info[index+1].par; 667 667 lower_aoi_is_open = lower_aoi_mfbi->count > 0 ? 1 : 0; 668 668 if (var->xres > base_plane_width) 669 669 var->xres = base_plane_width; ··· 681 681 break; 682 682 case PLANE1_AOI1: 683 683 case PLANE2_AOI1: 684 - upper_aoi_mfbi = machine_data->fsl_diu_info[index-1].par; 685 - upper_aoi_height = 686 - machine_data->fsl_diu_info[index-1].var.yres; 684 + upper_aoi_mfbi = data->fsl_diu_info[index-1].par; 685 + upper_aoi_height = data->fsl_diu_info[index-1].var.yres; 687 686 upper_aoi_bottom = upper_aoi_mfbi->y_aoi_d + upper_aoi_height; 688 687 upper_aoi_is_open = upper_aoi_mfbi->count > 0 ? 1 : 0; 689 688 if (var->xres > base_plane_width) ··· 822 823 { 823 824 struct fb_var_screeninfo *var = &info->var; 824 825 struct mfb_info *mfbi = info->par; 825 - struct fsl_diu_data *machine_data = mfbi->parent; 826 + struct fsl_diu_data *data = mfbi->parent; 826 827 struct diu __iomem *hw; 827 828 int i, j; 828 829 u8 *gamma_table_base; 829 830 830 831 u32 temp; 831 832 832 - hw = machine_data->diu_reg; 833 + hw = data->diu_reg; 833 834 834 - diu_ops.set_monitor_port(machine_data->monitor_port); 835 - gamma_table_base = machine_data->gamma; 835 + diu_ops.set_monitor_port(data->monitor_port); 836 + gamma_table_base = data->gamma; 836 837 837 838 /* Prep for DIU init - gamma table, cursor table */ 838 839 ··· 840 841 for (j = 0; j <= 255; j++) 841 842 *gamma_table_base++ = j; 842 843 843 - diu_ops.set_gamma_table(machine_data->monitor_port, 844 - machine_data->gamma); 844 + diu_ops.set_gamma_table(data->monitor_port, data->gamma); 845 845 846 846 disable_lcdc(info); 847 847 848 848 /* Program DIU registers */ 849 849 850 - out_be32(&hw->gamma, DMA_ADDR(machine_data, gamma)); 851 - out_be32(&hw->cursor, DMA_ADDR(machine_data, cursor)); 850 + out_be32(&hw->gamma, DMA_ADDR(data, gamma)); 851 + out_be32(&hw->cursor, DMA_ADDR(data, cursor)); 852 852 853 853 out_be32(&hw->bgnd, 0x007F7F7F); /* BGND */ 854 854 out_be32(&hw->bgnd_wb, 0); /* BGND_WB */ ··· 938 940 unsigned long len; 939 941 struct fb_var_screeninfo *var = &info->var; 940 942 struct mfb_info *mfbi = info->par; 941 - struct fsl_diu_data *machine_data = mfbi->parent; 943 + struct fsl_diu_data *data = mfbi->parent; 942 944 struct diu_ad *ad = mfbi->ad; 943 945 struct diu __iomem *hw; 944 946 945 - hw = machine_data->diu_reg; 947 + hw = data->diu_reg; 946 948 947 949 set_fix(info); 948 950 mfbi->cursor_reset = 1; ··· 960 962 } 961 963 } 962 964 963 - ad->pix_fmt = diu_ops.get_pixel_format(machine_data->monitor_port, 965 + ad->pix_fmt = diu_ops.get_pixel_format(data->monitor_port, 964 966 var->bits_per_pixel); 965 967 ad->addr = cpu_to_le32(info->fix.smem_start); 966 968 ad->src_size_g_alpha = cpu_to_le32((var->yres_virtual << 12) | ··· 1371 1373 return IRQ_NONE; 1372 1374 } 1373 1375 1374 - static int request_irq_local(struct fsl_diu_data *machine_data) 1376 + static int request_irq_local(struct fsl_diu_data *data) 1375 1377 { 1376 - struct diu __iomem *hw = machine_data->diu_reg; 1378 + struct diu __iomem *hw = data->diu_reg; 1377 1379 u32 ints; 1378 1380 int ret; 1379 1381 1380 1382 /* Read to clear the status */ 1381 1383 in_be32(&hw->int_status); 1382 1384 1383 - ret = request_irq(machine_data->irq, fsl_diu_isr, 0, "fsl-diu-fb", hw); 1385 + ret = request_irq(data->irq, fsl_diu_isr, 0, "fsl-diu-fb", hw); 1384 1386 if (!ret) { 1385 1387 ints = INT_PARERR | INT_LS_BF_VS; 1386 1388 #if !defined(CONFIG_NOT_COHERENT_CACHE) ··· 1395 1397 return ret; 1396 1398 } 1397 1399 1398 - static void free_irq_local(struct fsl_diu_data *machine_data) 1400 + static void free_irq_local(struct fsl_diu_data *data) 1399 1401 { 1400 - struct diu __iomem *hw = machine_data->diu_reg; 1402 + struct diu __iomem *hw = data->diu_reg; 1401 1403 1402 1404 /* Disable all LCDC interrupt */ 1403 1405 out_be32(&hw->int_mask, 0x1f); 1404 1406 1405 - free_irq(machine_data->irq, NULL); 1407 + free_irq(data->irq, NULL); 1406 1408 } 1407 1409 1408 1410 #ifdef CONFIG_PM ··· 1412 1414 */ 1413 1415 static int fsl_diu_suspend(struct platform_device *ofdev, pm_message_t state) 1414 1416 { 1415 - struct fsl_diu_data *machine_data; 1417 + struct fsl_diu_data *data; 1416 1418 1417 - machine_data = dev_get_drvdata(&ofdev->dev); 1418 - disable_lcdc(machine_data->fsl_diu_info[0]); 1419 + data = dev_get_drvdata(&ofdev->dev); 1420 + disable_lcdc(data->fsl_diu_info[0]); 1419 1421 1420 1422 return 0; 1421 1423 } 1422 1424 1423 1425 static int fsl_diu_resume(struct platform_device *ofdev) 1424 1426 { 1425 - struct fsl_diu_data *machine_data; 1427 + struct fsl_diu_data *data; 1426 1428 1427 - machine_data = dev_get_drvdata(&ofdev->dev); 1428 - enable_lcdc(machine_data->fsl_diu_info[0]); 1429 + data = dev_get_drvdata(&ofdev->dev); 1430 + enable_lcdc(data->fsl_diu_info[0]); 1429 1431 1430 1432 return 0; 1431 1433 } ··· 1439 1441 struct device_attribute *attr, const char *buf, size_t count) 1440 1442 { 1441 1443 enum fsl_diu_monitor_port old_monitor_port; 1442 - struct fsl_diu_data *machine_data = 1444 + struct fsl_diu_data *data = 1443 1445 container_of(attr, struct fsl_diu_data, dev_attr); 1444 1446 1445 - old_monitor_port = machine_data->monitor_port; 1446 - machine_data->monitor_port = fsl_diu_name_to_port(buf); 1447 + old_monitor_port = data->monitor_port; 1448 + data->monitor_port = fsl_diu_name_to_port(buf); 1447 1449 1448 - if (old_monitor_port != machine_data->monitor_port) { 1450 + if (old_monitor_port != data->monitor_port) { 1449 1451 /* All AOIs need adjust pixel format 1450 1452 * fsl_diu_set_par only change the pixsel format here 1451 1453 * unlikely to fail. */ 1452 1454 unsigned int i; 1453 1455 1454 1456 for (i=0; i < NUM_AOIS; i++) 1455 - fsl_diu_set_par(&machine_data->fsl_diu_info[i]); 1457 + fsl_diu_set_par(&data->fsl_diu_info[i]); 1456 1458 } 1457 1459 return count; 1458 1460 } ··· 1460 1462 static ssize_t show_monitor(struct device *device, 1461 1463 struct device_attribute *attr, char *buf) 1462 1464 { 1463 - struct fsl_diu_data *machine_data = 1465 + struct fsl_diu_data *data = 1464 1466 container_of(attr, struct fsl_diu_data, dev_attr); 1465 1467 1466 - switch (machine_data->monitor_port) { 1468 + switch (data->monitor_port) { 1467 1469 case FSL_DIU_PORT_DVI: 1468 1470 return sprintf(buf, "DVI\n"); 1469 1471 case FSL_DIU_PORT_LVDS: ··· 1479 1481 { 1480 1482 struct device_node *np = pdev->dev.of_node; 1481 1483 struct mfb_info *mfbi; 1482 - struct fsl_diu_data *machine_data; 1484 + struct fsl_diu_data *data; 1483 1485 int diu_mode; 1484 - dma_addr_t dma_addr; /* DMA addr of machine_data struct */ 1486 + dma_addr_t dma_addr; /* DMA addr of fsl_diu_data struct */ 1485 1487 unsigned int i; 1486 1488 int ret; 1487 1489 1488 - machine_data = dma_alloc_coherent(&pdev->dev, 1489 - sizeof(struct fsl_diu_data), &dma_addr, GFP_DMA | __GFP_ZERO); 1490 - if (!machine_data) 1490 + data = dma_alloc_coherent(&pdev->dev, sizeof(struct fsl_diu_data), 1491 + &dma_addr, GFP_DMA | __GFP_ZERO); 1492 + if (!data) 1491 1493 return -ENOMEM; 1492 - machine_data->dma_addr = dma_addr; 1494 + data->dma_addr = dma_addr; 1493 1495 1494 1496 /* 1495 1497 * dma_alloc_coherent() uses a page allocator, so the address is ··· 1498 1500 * need to catch that. It's not worth the effort to handle unaligned 1499 1501 * alloctions now because it's highly unlikely to ever be a problem. 1500 1502 */ 1501 - if ((unsigned long)machine_data & 31) { 1503 + if ((unsigned long)data & 31) { 1502 1504 dev_err(&pdev->dev, "misaligned allocation"); 1503 1505 ret = -ENOMEM; 1504 1506 goto error; 1505 1507 } 1506 1508 1507 - spin_lock_init(&machine_data->reg_lock); 1509 + spin_lock_init(&data->reg_lock); 1508 1510 1509 1511 for (i = 0; i < NUM_AOIS; i++) { 1510 - struct fb_info *info = &machine_data->fsl_diu_info[i]; 1512 + struct fb_info *info = &data->fsl_diu_info[i]; 1511 1513 1512 1514 info->device = &pdev->dev; 1513 - info->par = &machine_data->mfb[i]; 1515 + info->par = &data->mfb[i]; 1514 1516 1515 1517 /* 1516 1518 * We store the physical address of the AD in the reserved 1517 1519 * 'paddr' field of the AD itself. 1518 1520 */ 1519 - machine_data->ad[i].paddr = DMA_ADDR(machine_data, ad[i]); 1521 + data->ad[i].paddr = DMA_ADDR(data, ad[i]); 1520 1522 1521 1523 info->fix.smem_start = 0; 1522 1524 1523 1525 /* Initialize the AOI data structure */ 1524 1526 mfbi = info->par; 1525 1527 memcpy(mfbi, &mfb_template[i], sizeof(struct mfb_info)); 1526 - mfbi->parent = machine_data; 1527 - mfbi->ad = &machine_data->ad[i]; 1528 + mfbi->parent = data; 1529 + mfbi->ad = &data->ad[i]; 1528 1530 1529 1531 if (mfbi->index == PLANE0) { 1530 1532 const u8 *prop; ··· 1538 1540 } 1539 1541 } 1540 1542 1541 - machine_data->diu_reg = of_iomap(np, 0); 1542 - if (!machine_data->diu_reg) { 1543 + data->diu_reg = of_iomap(np, 0); 1544 + if (!data->diu_reg) { 1543 1545 dev_err(&pdev->dev, "cannot map DIU registers\n"); 1544 1546 ret = -EFAULT; 1545 1547 goto error; 1546 1548 } 1547 1549 1548 - diu_mode = in_be32(&machine_data->diu_reg->diu_mode); 1550 + diu_mode = in_be32(&data->diu_reg->diu_mode); 1549 1551 if (diu_mode == MFB_MODE0) 1550 - out_be32(&machine_data->diu_reg->diu_mode, 0); /* disable DIU */ 1552 + out_be32(&data->diu_reg->diu_mode, 0); /* disable DIU */ 1551 1553 1552 1554 /* Get the IRQ of the DIU */ 1553 - machine_data->irq = irq_of_parse_and_map(np, 0); 1555 + data->irq = irq_of_parse_and_map(np, 0); 1554 1556 1555 - if (!machine_data->irq) { 1557 + if (!data->irq) { 1556 1558 dev_err(&pdev->dev, "could not get DIU IRQ\n"); 1557 1559 ret = -EINVAL; 1558 1560 goto error; 1559 1561 } 1560 - machine_data->monitor_port = monitor_port; 1562 + data->monitor_port = monitor_port; 1561 1563 1562 1564 /* Initialize the dummy Area Descriptor */ 1563 - machine_data->dummy_ad.addr = 1564 - cpu_to_le32(DMA_ADDR(machine_data, dummy_aoi)); 1565 - machine_data->dummy_ad.pix_fmt = 0x88882317; 1566 - machine_data->dummy_ad.src_size_g_alpha = cpu_to_le32((4 << 12) | 4); 1567 - machine_data->dummy_ad.aoi_size = cpu_to_le32((4 << 16) | 2); 1568 - machine_data->dummy_ad.offset_xyi = 0; 1569 - machine_data->dummy_ad.offset_xyd = 0; 1570 - machine_data->dummy_ad.next_ad = 0; 1571 - machine_data->dummy_ad.paddr = DMA_ADDR(machine_data, dummy_ad); 1565 + data->dummy_ad.addr = cpu_to_le32(DMA_ADDR(data, dummy_aoi)); 1566 + data->dummy_ad.pix_fmt = 0x88882317; 1567 + data->dummy_ad.src_size_g_alpha = cpu_to_le32((4 << 12) | 4); 1568 + data->dummy_ad.aoi_size = cpu_to_le32((4 << 16) | 2); 1569 + data->dummy_ad.offset_xyi = 0; 1570 + data->dummy_ad.offset_xyd = 0; 1571 + data->dummy_ad.next_ad = 0; 1572 + data->dummy_ad.paddr = DMA_ADDR(data, dummy_ad); 1572 1573 1573 1574 /* 1574 1575 * Let DIU display splash screen if it was pre-initialized 1575 1576 * by the bootloader, set dummy area descriptor otherwise. 1576 1577 */ 1577 1578 if (diu_mode == MFB_MODE0) 1578 - out_be32(&machine_data->diu_reg->desc[0], 1579 - machine_data->dummy_ad.paddr); 1579 + out_be32(&data->diu_reg->desc[0], data->dummy_ad.paddr); 1580 1580 1581 - out_be32(&machine_data->diu_reg->desc[1], machine_data->dummy_ad.paddr); 1582 - out_be32(&machine_data->diu_reg->desc[2], machine_data->dummy_ad.paddr); 1581 + out_be32(&data->diu_reg->desc[1], data->dummy_ad.paddr); 1582 + out_be32(&data->diu_reg->desc[2], data->dummy_ad.paddr); 1583 1583 1584 1584 for (i = 0; i < NUM_AOIS; i++) { 1585 - ret = install_fb(&machine_data->fsl_diu_info[i]); 1585 + ret = install_fb(&data->fsl_diu_info[i]); 1586 1586 if (ret) { 1587 1587 dev_err(&pdev->dev, "could not register fb %d\n", i); 1588 1588 goto error; 1589 1589 } 1590 1590 } 1591 1591 1592 - if (request_irq_local(machine_data)) { 1592 + if (request_irq_local(data)) { 1593 1593 dev_err(&pdev->dev, "could not claim irq\n"); 1594 1594 goto error; 1595 1595 } 1596 1596 1597 - sysfs_attr_init(&machine_data->dev_attr.attr); 1598 - machine_data->dev_attr.attr.name = "monitor"; 1599 - machine_data->dev_attr.attr.mode = S_IRUGO|S_IWUSR; 1600 - machine_data->dev_attr.show = show_monitor; 1601 - machine_data->dev_attr.store = store_monitor; 1602 - ret = device_create_file(&pdev->dev, &machine_data->dev_attr); 1597 + sysfs_attr_init(&data->dev_attr.attr); 1598 + data->dev_attr.attr.name = "monitor"; 1599 + data->dev_attr.attr.mode = S_IRUGO|S_IWUSR; 1600 + data->dev_attr.show = show_monitor; 1601 + data->dev_attr.store = store_monitor; 1602 + ret = device_create_file(&pdev->dev, &data->dev_attr); 1603 1603 if (ret) { 1604 1604 dev_err(&pdev->dev, "could not create sysfs file %s\n", 1605 - machine_data->dev_attr.attr.name); 1605 + data->dev_attr.attr.name); 1606 1606 } 1607 1607 1608 - dev_set_drvdata(&pdev->dev, machine_data); 1608 + dev_set_drvdata(&pdev->dev, data); 1609 1609 return 0; 1610 1610 1611 1611 error: 1612 1612 for (i = 0; i < NUM_AOIS; i++) 1613 - uninstall_fb(&machine_data->fsl_diu_info[i]); 1613 + uninstall_fb(&data->fsl_diu_info[i]); 1614 1614 1615 - iounmap(machine_data->diu_reg); 1615 + iounmap(data->diu_reg); 1616 1616 1617 - dma_free_coherent(&pdev->dev, sizeof(struct fsl_diu_data), 1618 - machine_data, machine_data->dma_addr); 1617 + dma_free_coherent(&pdev->dev, sizeof(struct fsl_diu_data), data, 1618 + data->dma_addr); 1619 1619 1620 1620 return ret; 1621 1621 } 1622 1622 1623 1623 static int fsl_diu_remove(struct platform_device *pdev) 1624 1624 { 1625 - struct fsl_diu_data *machine_data; 1625 + struct fsl_diu_data *data; 1626 1626 int i; 1627 1627 1628 - machine_data = dev_get_drvdata(&pdev->dev); 1629 - disable_lcdc(&machine_data->fsl_diu_info[0]); 1630 - free_irq_local(machine_data); 1628 + data = dev_get_drvdata(&pdev->dev); 1629 + disable_lcdc(&data->fsl_diu_info[0]); 1630 + free_irq_local(data); 1631 1631 1632 1632 for (i = 0; i < NUM_AOIS; i++) 1633 - uninstall_fb(&machine_data->fsl_diu_info[i]); 1633 + uninstall_fb(&data->fsl_diu_info[i]); 1634 1634 1635 - iounmap(machine_data->diu_reg); 1635 + iounmap(data->diu_reg); 1636 1636 1637 - dma_free_coherent(&pdev->dev, sizeof(struct fsl_diu_data), 1638 - machine_data, machine_data->dma_addr); 1637 + dma_free_coherent(&pdev->dev, sizeof(struct fsl_diu_data), data, 1638 + data->dma_addr); 1639 1639 1640 1640 return 0; 1641 1641 }