Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 113106
b: refs/heads/master
c: 3baca76
h: refs/heads/master
v: v3
  • Loading branch information
Krzysztof Helt authored and David S. Miller committed Sep 8, 2008
1 parent 7f50311 commit 8144c8a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1aa0365f275f7df6bb1e0b6667ed2b54199fe21d
refs/heads/master: 3baca76f5653482f4b7fe1fc400b01877f6b2d92
6 changes: 4 additions & 2 deletions trunk/arch/sparc64/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -500,14 +500,15 @@ static struct of_platform_driver bq4802_driver = {
static unsigned char mostek_read_byte(struct device *dev, u32 ofs)
{
struct platform_device *pdev = to_platform_device(dev);
struct m48t59_plat_data *pdata = pdev->dev.platform_data;
void __iomem *regs;
unsigned char val;

regs = (void __iomem *) pdev->resource[0].start;
val = readb(regs + ofs);

/* the year 0 is 1968 */
if (ofs == M48T59_YEAR) {
if (ofs == pdata->offset + M48T59_YEAR) {
val += 0x68;
if ((val & 0xf) > 9)
val += 6;
Expand All @@ -518,10 +519,11 @@ static unsigned char mostek_read_byte(struct device *dev, u32 ofs)
static void mostek_write_byte(struct device *dev, u32 ofs, u8 val)
{
struct platform_device *pdev = to_platform_device(dev);
struct m48t59_plat_data *pdata = pdev->dev.platform_data;
void __iomem *regs;

regs = (void __iomem *) pdev->resource[0].start;
if (ofs == M48T59_YEAR) {
if (ofs == pdata->offset + M48T59_YEAR) {
if (val < 0x68)
val += 0x32;
else
Expand Down

0 comments on commit 8144c8a

Please sign in to comment.