|
@@ -111,7 +111,7 @@ static u32 *ps3vram_get_notifier(u32 *reports, int notifier)
|
|
|
|
|
|
static void ps3vram_notifier_reset(struct ps3_system_bus_device *dev)
|
|
|
{
|
|
|
- struct ps3vram_priv *priv = dev->core.driver_data;
|
|
|
+ struct ps3vram_priv *priv = dev_get_drvdata(&dev->core);
|
|
|
u32 *notify = ps3vram_get_notifier(priv->reports, NOTIFIER);
|
|
|
int i;
|
|
|
|
|
@@ -122,7 +122,7 @@ static void ps3vram_notifier_reset(struct ps3_system_bus_device *dev)
|
|
|
static int ps3vram_notifier_wait(struct ps3_system_bus_device *dev,
|
|
|
unsigned int timeout_ms)
|
|
|
{
|
|
|
- struct ps3vram_priv *priv = dev->core.driver_data;
|
|
|
+ struct ps3vram_priv *priv = dev_get_drvdata(&dev->core);
|
|
|
u32 *notify = ps3vram_get_notifier(priv->reports, NOTIFIER);
|
|
|
unsigned long timeout = jiffies + msecs_to_jiffies(timeout_ms);
|
|
|
|
|
@@ -137,7 +137,7 @@ static int ps3vram_notifier_wait(struct ps3_system_bus_device *dev,
|
|
|
|
|
|
static void ps3vram_init_ring(struct ps3_system_bus_device *dev)
|
|
|
{
|
|
|
- struct ps3vram_priv *priv = dev->core.driver_data;
|
|
|
+ struct ps3vram_priv *priv = dev_get_drvdata(&dev->core);
|
|
|
|
|
|
priv->ctrl[CTRL_PUT] = FIFO_BASE + FIFO_OFFSET;
|
|
|
priv->ctrl[CTRL_GET] = FIFO_BASE + FIFO_OFFSET;
|
|
@@ -146,7 +146,7 @@ static void ps3vram_init_ring(struct ps3_system_bus_device *dev)
|
|
|
static int ps3vram_wait_ring(struct ps3_system_bus_device *dev,
|
|
|
unsigned int timeout_ms)
|
|
|
{
|
|
|
- struct ps3vram_priv *priv = dev->core.driver_data;
|
|
|
+ struct ps3vram_priv *priv = dev_get_drvdata(&dev->core);
|
|
|
unsigned long timeout = jiffies + msecs_to_jiffies(timeout_ms);
|
|
|
|
|
|
do {
|
|
@@ -175,7 +175,7 @@ static void ps3vram_begin_ring(struct ps3vram_priv *priv, u32 chan, u32 tag,
|
|
|
|
|
|
static void ps3vram_rewind_ring(struct ps3_system_bus_device *dev)
|
|
|
{
|
|
|
- struct ps3vram_priv *priv = dev->core.driver_data;
|
|
|
+ struct ps3vram_priv *priv = dev_get_drvdata(&dev->core);
|
|
|
int status;
|
|
|
|
|
|
ps3vram_out_ring(priv, 0x20000000 | (FIFO_BASE + FIFO_OFFSET));
|
|
@@ -196,7 +196,7 @@ static void ps3vram_rewind_ring(struct ps3_system_bus_device *dev)
|
|
|
|
|
|
static void ps3vram_fire_ring(struct ps3_system_bus_device *dev)
|
|
|
{
|
|
|
- struct ps3vram_priv *priv = dev->core.driver_data;
|
|
|
+ struct ps3vram_priv *priv = dev_get_drvdata(&dev->core);
|
|
|
int status;
|
|
|
|
|
|
mutex_lock(&ps3_gpu_mutex);
|
|
@@ -225,7 +225,7 @@ static void ps3vram_fire_ring(struct ps3_system_bus_device *dev)
|
|
|
|
|
|
static void ps3vram_bind(struct ps3_system_bus_device *dev)
|
|
|
{
|
|
|
- struct ps3vram_priv *priv = dev->core.driver_data;
|
|
|
+ struct ps3vram_priv *priv = dev_get_drvdata(&dev->core);
|
|
|
|
|
|
ps3vram_begin_ring(priv, UPLOAD_SUBCH, 0, 1);
|
|
|
ps3vram_out_ring(priv, 0x31337303);
|
|
@@ -248,7 +248,7 @@ static int ps3vram_upload(struct ps3_system_bus_device *dev,
|
|
|
unsigned int src_offset, unsigned int dst_offset,
|
|
|
int len, int count)
|
|
|
{
|
|
|
- struct ps3vram_priv *priv = dev->core.driver_data;
|
|
|
+ struct ps3vram_priv *priv = dev_get_drvdata(&dev->core);
|
|
|
|
|
|
ps3vram_begin_ring(priv, UPLOAD_SUBCH,
|
|
|
NV_MEMORY_TO_MEMORY_FORMAT_OFFSET_IN, 8);
|
|
@@ -280,7 +280,7 @@ static int ps3vram_download(struct ps3_system_bus_device *dev,
|
|
|
unsigned int src_offset, unsigned int dst_offset,
|
|
|
int len, int count)
|
|
|
{
|
|
|
- struct ps3vram_priv *priv = dev->core.driver_data;
|
|
|
+ struct ps3vram_priv *priv = dev_get_drvdata(&dev->core);
|
|
|
|
|
|
ps3vram_begin_ring(priv, DOWNLOAD_SUBCH,
|
|
|
NV_MEMORY_TO_MEMORY_FORMAT_OFFSET_IN, 8);
|
|
@@ -310,7 +310,7 @@ static int ps3vram_download(struct ps3_system_bus_device *dev,
|
|
|
|
|
|
static void ps3vram_cache_evict(struct ps3_system_bus_device *dev, int entry)
|
|
|
{
|
|
|
- struct ps3vram_priv *priv = dev->core.driver_data;
|
|
|
+ struct ps3vram_priv *priv = dev_get_drvdata(&dev->core);
|
|
|
struct ps3vram_cache *cache = &priv->cache;
|
|
|
|
|
|
if (!(cache->tags[entry].flags & CACHE_PAGE_DIRTY))
|
|
@@ -332,7 +332,7 @@ static void ps3vram_cache_evict(struct ps3_system_bus_device *dev, int entry)
|
|
|
static void ps3vram_cache_load(struct ps3_system_bus_device *dev, int entry,
|
|
|
unsigned int address)
|
|
|
{
|
|
|
- struct ps3vram_priv *priv = dev->core.driver_data;
|
|
|
+ struct ps3vram_priv *priv = dev_get_drvdata(&dev->core);
|
|
|
struct ps3vram_cache *cache = &priv->cache;
|
|
|
|
|
|
dev_dbg(&dev->core, "Fetching %d: 0x%08x\n", entry, address);
|
|
@@ -352,7 +352,7 @@ static void ps3vram_cache_load(struct ps3_system_bus_device *dev, int entry,
|
|
|
|
|
|
static void ps3vram_cache_flush(struct ps3_system_bus_device *dev)
|
|
|
{
|
|
|
- struct ps3vram_priv *priv = dev->core.driver_data;
|
|
|
+ struct ps3vram_priv *priv = dev_get_drvdata(&dev->core);
|
|
|
struct ps3vram_cache *cache = &priv->cache;
|
|
|
int i;
|
|
|
|
|
@@ -366,7 +366,7 @@ static void ps3vram_cache_flush(struct ps3_system_bus_device *dev)
|
|
|
static unsigned int ps3vram_cache_match(struct ps3_system_bus_device *dev,
|
|
|
loff_t address)
|
|
|
{
|
|
|
- struct ps3vram_priv *priv = dev->core.driver_data;
|
|
|
+ struct ps3vram_priv *priv = dev_get_drvdata(&dev->core);
|
|
|
struct ps3vram_cache *cache = &priv->cache;
|
|
|
unsigned int base;
|
|
|
unsigned int offset;
|
|
@@ -400,7 +400,7 @@ static unsigned int ps3vram_cache_match(struct ps3_system_bus_device *dev,
|
|
|
|
|
|
static int ps3vram_cache_init(struct ps3_system_bus_device *dev)
|
|
|
{
|
|
|
- struct ps3vram_priv *priv = dev->core.driver_data;
|
|
|
+ struct ps3vram_priv *priv = dev_get_drvdata(&dev->core);
|
|
|
|
|
|
priv->cache.page_count = CACHE_PAGE_COUNT;
|
|
|
priv->cache.page_size = CACHE_PAGE_SIZE;
|
|
@@ -419,7 +419,7 @@ static int ps3vram_cache_init(struct ps3_system_bus_device *dev)
|
|
|
|
|
|
static void ps3vram_cache_cleanup(struct ps3_system_bus_device *dev)
|
|
|
{
|
|
|
- struct ps3vram_priv *priv = dev->core.driver_data;
|
|
|
+ struct ps3vram_priv *priv = dev_get_drvdata(&dev->core);
|
|
|
|
|
|
ps3vram_cache_flush(dev);
|
|
|
kfree(priv->cache.tags);
|
|
@@ -428,7 +428,7 @@ static void ps3vram_cache_cleanup(struct ps3_system_bus_device *dev)
|
|
|
static int ps3vram_read(struct ps3_system_bus_device *dev, loff_t from,
|
|
|
size_t len, size_t *retlen, u_char *buf)
|
|
|
{
|
|
|
- struct ps3vram_priv *priv = dev->core.driver_data;
|
|
|
+ struct ps3vram_priv *priv = dev_get_drvdata(&dev->core);
|
|
|
unsigned int cached, count;
|
|
|
|
|
|
dev_dbg(&dev->core, "%s: from=0x%08x len=0x%zx\n", __func__,
|
|
@@ -476,7 +476,7 @@ static int ps3vram_read(struct ps3_system_bus_device *dev, loff_t from,
|
|
|
static int ps3vram_write(struct ps3_system_bus_device *dev, loff_t to,
|
|
|
size_t len, size_t *retlen, const u_char *buf)
|
|
|
{
|
|
|
- struct ps3vram_priv *priv = dev->core.driver_data;
|
|
|
+ struct ps3vram_priv *priv = dev_get_drvdata(&dev->core);
|
|
|
unsigned int cached, count;
|
|
|
|
|
|
if (to >= priv->size)
|
|
@@ -543,7 +543,7 @@ static const struct file_operations ps3vram_proc_fops = {
|
|
|
|
|
|
static void __devinit ps3vram_proc_init(struct ps3_system_bus_device *dev)
|
|
|
{
|
|
|
- struct ps3vram_priv *priv = dev->core.driver_data;
|
|
|
+ struct ps3vram_priv *priv = dev_get_drvdata(&dev->core);
|
|
|
struct proc_dir_entry *pde;
|
|
|
|
|
|
pde = proc_create(DEVICE_NAME, 0444, NULL, &ps3vram_proc_fops);
|
|
@@ -615,9 +615,9 @@ static int __devinit ps3vram_probe(struct ps3_system_bus_device *dev)
|
|
|
}
|
|
|
|
|
|
mutex_init(&priv->lock);
|
|
|
- dev->core.driver_data = priv;
|
|
|
+ dev_set_drvdata(&dev->core, priv);
|
|
|
|
|
|
- priv = dev->core.driver_data;
|
|
|
+ priv = dev_get_drvdata(&dev->core);
|
|
|
|
|
|
/* Allocate XDR buffer (1MiB aligned) */
|
|
|
priv->xdr_buf = (void *)__get_free_pages(GFP_KERNEL,
|
|
@@ -787,14 +787,14 @@ out_free_xdr_buf:
|
|
|
free_pages((unsigned long) priv->xdr_buf, get_order(XDR_BUF_SIZE));
|
|
|
fail_free_priv:
|
|
|
kfree(priv);
|
|
|
- dev->core.driver_data = NULL;
|
|
|
+ dev_set_drvdata(&dev->core, NULL);
|
|
|
fail:
|
|
|
return error;
|
|
|
}
|
|
|
|
|
|
static int ps3vram_remove(struct ps3_system_bus_device *dev)
|
|
|
{
|
|
|
- struct ps3vram_priv *priv = dev->core.driver_data;
|
|
|
+ struct ps3vram_priv *priv = dev_get_drvdata(&dev->core);
|
|
|
|
|
|
del_gendisk(priv->gendisk);
|
|
|
put_disk(priv->gendisk);
|
|
@@ -809,7 +809,7 @@ static int ps3vram_remove(struct ps3_system_bus_device *dev)
|
|
|
ps3_close_hv_device(dev);
|
|
|
free_pages((unsigned long) priv->xdr_buf, get_order(XDR_BUF_SIZE));
|
|
|
kfree(priv);
|
|
|
- dev->core.driver_data = NULL;
|
|
|
+ dev_set_drvdata(&dev->core, NULL);
|
|
|
return 0;
|
|
|
}
|
|
|
|