* the project's page is at https://linuxtv.org
  */
 
-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
 #include "budget.h"
 #include "stv0299.h"
        if (slot != 0)
                return -EINVAL;
 
-       dprintk(1, "ciintf_slot_reset\n");
+       dprintk(1, "ci slot reset\n");
        budget_av->slot_status = SLOTSTATUS_RESET;
 
        saa7146_setgpio(saa, 2, SAA7146_GPIO_OUTHI); /* disable card */
        if (slot != 0)
                return -EINVAL;
 
-       dprintk(1, "ciintf_slot_shutdown\n");
+       dprintk(1, "ci slot shutdown\n");
 
        ttpci_budget_set_video_port(saa, BUDGET_VIDEO_PORTB);
        budget_av->slot_status = SLOTSTATUS_NONE;
        if (slot != 0)
                return -EINVAL;
 
-       dprintk(1, "ciintf_slot_ts_enable: %d\n", budget_av->slot_status);
+       dprintk(1, "ci slot status: %d\n", budget_av->slot_status);
 
        ttpci_budget_set_video_port(saa, BUDGET_VIDEO_PORTA);
 
                if (err != 0) {
                        ttpci_budget_deinit(&budget_av->budget);
                        kfree(budget_av);
-                       ERR("cannot init vv subsystem\n");
+                       pr_err("cannot init vv subsystem\n");
                        return err;
                }
                vv_data.vid_ops.vidioc_enum_input = vidioc_enum_input;
                        saa7146_vv_release(dev);
                        ttpci_budget_deinit(&budget_av->budget);
                        kfree(budget_av);
-                       ERR("cannot register capture v4l2 device\n");
+                       pr_err("cannot register capture v4l2 device\n");
                        return err;
                }
 
 
         */
 
        if (ir_debug)
-               printk("budget_ci: received byte 0x%02x\n", command);
+               pr_info("received byte 0x%02x\n", command);
 
        /* Remove repeat bit, we use every command */
        command = command & 0x7f;
 
        dev = rc_allocate_device(RC_DRIVER_SCANCODE);
        if (!dev) {
-               printk(KERN_ERR "budget_ci: IR interface initialisation failed\n");
+               pr_err("IR interface initialisation failed\n");
                return -ENOMEM;
        }
 
 
        error = rc_register_device(dev);
        if (error) {
-               printk(KERN_ERR "budget_ci: could not init driver for IR device (code %d)\n", error);
+               pr_err("could not init driver for IR device (code %d)\n", error);
                rc_free_device(dev);
                return error;
        }
        result = dvb_ca_en50221_init(&budget_ci->budget.dvb_adapter,
                                     &budget_ci->ca, ca_flags, 1);
        if (result != 0) {
-               printk("budget_ci: CI interface detected, but initialisation failed.\n");
+               pr_err("CI interface detected, but initialisation failed.\n");
                goto error;
        }
 
                               CICONTROL_RESET, 1, 0);
 
        // success!
-       printk("budget_ci: CI interface initialised\n");
+       pr_info("CI interface initialised\n");
        budget_ci->budget.ci_present = 1;
 
        // forge a fake CI IRQ so the CAM state is setup correctly
 
                        budget_ci->budget.dvb_frontend->ops.dishnetwork_send_legacy_command = NULL;
                        if (dvb_attach(lnbp21_attach, budget_ci->budget.dvb_frontend, &budget_ci->budget.i2c_adap, LNBP21_LLC, 0) == NULL) {
-                               printk("%s: No LNBP21 found!\n", __func__);
+                               pr_err("%s(): No LNBP21 found!\n", __func__);
                                dvb_frontend_detach(budget_ci->budget.dvb_frontend);
                                budget_ci->budget.dvb_frontend = NULL;
                        }
                budget_ci->budget.dvb_frontend = dvb_attach(tda10023_attach, &tda10023_config, &budget_ci->budget.i2c_adap, 0x48);
                if (budget_ci->budget.dvb_frontend) {
                        if (dvb_attach(tda827x_attach, budget_ci->budget.dvb_frontend, 0x61, &budget_ci->budget.i2c_adap, &tda827x_config) == NULL) {
-                               printk(KERN_ERR "%s: No tda827x found!\n", __func__);
+                               pr_err("%s(): No tda827x found!\n", __func__);
                                dvb_frontend_detach(budget_ci->budget.dvb_frontend);
                                budget_ci->budget.dvb_frontend = NULL;
                        }
                if (budget_ci->budget.dvb_frontend) {
                        if (dvb_attach(stb6000_attach, budget_ci->budget.dvb_frontend, 0x63, &budget_ci->budget.i2c_adap)) {
                                if (!dvb_attach(lnbp21_attach, budget_ci->budget.dvb_frontend, &budget_ci->budget.i2c_adap, 0, 0)) {
-                                       printk(KERN_ERR "%s: No LNBP21 found!\n", __func__);
+                                       pr_err("%s(): No LNBP21 found!\n", __func__);
                                        dvb_frontend_detach(budget_ci->budget.dvb_frontend);
                                        budget_ci->budget.dvb_frontend = NULL;
                                }
                        } else {
-                               printk(KERN_ERR "%s: No STB6000 found!\n", __func__);
+                               pr_err("%s(): No STB6000 found!\n", __func__);
                                dvb_frontend_detach(budget_ci->budget.dvb_frontend);
                                budget_ci->budget.dvb_frontend = NULL;
                        }
                if (budget_ci->budget.dvb_frontend) {
                        if (dvb_attach(stb6100_attach, budget_ci->budget.dvb_frontend, &tt3200_stb6100_config, &budget_ci->budget.i2c_adap)) {
                                if (!dvb_attach(lnbp21_attach, budget_ci->budget.dvb_frontend, &budget_ci->budget.i2c_adap, 0, 0)) {
-                                       printk("%s: No LNBP21 found!\n", __func__);
+                                       pr_err("%s(): No LNBP21 found!\n", __func__);
                                        dvb_frontend_detach(budget_ci->budget.dvb_frontend);
                                        budget_ci->budget.dvb_frontend = NULL;
                                }
        }
 
        if (budget_ci->budget.dvb_frontend == NULL) {
-               printk("budget-ci: A frontend driver was not found for device [%04x:%04x] subsystem [%04x:%04x]\n",
+               pr_err("A frontend driver was not found for device [%04x:%04x] subsystem [%04x:%04x]\n",
                       budget_ci->budget.dev->pci->vendor,
                       budget_ci->budget.dev->pci->device,
                       budget_ci->budget.dev->pci->subsystem_vendor,
        } else {
                if (dvb_register_frontend
                    (&budget_ci->budget.dvb_adapter, budget_ci->budget.dvb_frontend)) {
-                       printk("budget-ci: Frontend registration failed!\n");
+                       pr_err("Frontend registration failed!\n");
                        dvb_frontend_detach(budget_ci->budget.dvb_frontend);
                        budget_ci->budget.dvb_frontend = NULL;
                }
 
                budget->buffer_warnings++;
 
        if (budget->buffer_warnings && time_after(jiffies, budget->buffer_warning_time)) {
-               printk("%s %s: used %d times >80%% of buffer (%u bytes now)\n",
+               pr_warn("%s %s: used %d times >80%% of buffer (%u bytes now)\n",
                        budget->dev->name, __func__, budget->buffer_warnings, count);
                budget->buffer_warning_time = jiffies + BUFFER_WARNING_WAIT;
                budget->buffer_warnings = 0;
                budget->dev->name,
                budget->buffer_size > budget->buffer_width * budget->buffer_height ? "odd/even" : "single",
                budget->buffer_width, budget->buffer_height);
-       printk("%s: dma buffer size %u\n", budget->dev->name, budget->buffer_size);
+       pr_info("%s: dma buffer size %u\n", budget->dev->name, budget->buffer_size);
 
        ret = dvb_register_adapter(&budget->dvb_adapter, budget->card->name,
                                   owner, &budget->dev->pci->dev, adapter_nums);
 
        case 0x4f52: /* Cards based on Philips Semi Sylt PCI ref. design */
                budget->dvb_frontend = dvb_attach(stv0299_attach, &alps_bsru6_config, &budget->i2c_adap);
                if (budget->dvb_frontend) {
-                       printk(KERN_INFO "budget: tuner ALPS BSRU6 in Philips Semi. Sylt detected\n");
+                       pr_info("tuner ALPS BSRU6 in Philips Semi. Sylt detected\n");
                        budget->dvb_frontend->ops.tuner_ops.set_params = alps_bsru6_tuner_set_params;
                        budget->dvb_frontend->tuner_priv = &budget->i2c_adap;
                        break;
                        /* assume ALPS BSRU6 */
                        budget->dvb_frontend = dvb_attach(stv0299_attach, &alps_bsru6_config_activy, &budget->i2c_adap);
                        if (budget->dvb_frontend) {
-                               printk(KERN_INFO "budget: tuner ALPS BSRU6 detected\n");
+                               pr_info("tuner ALPS BSRU6 detected\n");
                                budget->dvb_frontend->ops.tuner_ops.set_params = alps_bsru6_tuner_set_params;
                                budget->dvb_frontend->tuner_priv = &budget->i2c_adap;
                                budget->dvb_frontend->ops.set_voltage = siemens_budget_set_voltage;
                        msleep(250);
                        budget->dvb_frontend = dvb_attach(stv0299_attach, &alps_bsbe1_config_activy, &budget->i2c_adap);
                        if (budget->dvb_frontend) {
-                               printk(KERN_INFO "budget: tuner ALPS BSBE1 detected\n");
+                               pr_info("tuner ALPS BSBE1 detected\n");
                                budget->dvb_frontend->ops.tuner_ops.set_params = alps_bsbe1_tuner_set_params;
                                budget->dvb_frontend->tuner_priv = &budget->i2c_adap;
                                budget->dvb_frontend->ops.set_voltage = siemens_budget_set_voltage;
                        budget->dvb_frontend = fe;
                        if (dvb_attach(lnbp21_attach, fe, &budget->i2c_adap,
                                       0, 0) == NULL) {
-                               printk("%s: No LNBP21 found!\n", __func__);
+                               pr_err("%s(): No LNBP21 found!\n", __func__);
                                goto error_out;
                        }
                        break;
                        budget->dvb_frontend = fe;
                        if (dvb_attach(tda826x_attach, fe, 0x60,
                                       &budget->i2c_adap, 0) == NULL)
-                               printk("%s: No tda826x found!\n", __func__);
+                               pr_err("%s(): No tda826x found!\n", __func__);
                        if (dvb_attach(lnbp21_attach, fe,
                                       &budget->i2c_adap, 0, 0) == NULL) {
-                               printk("%s: No LNBP21 found!\n", __func__);
+                               pr_err("%s(): No LNBP21 found!\n", __func__);
                                goto error_out;
                        }
                        break;
                                                       budget->dvb_frontend,
                                                       &budget->i2c_adap,
                                                       &tt1600_isl6423_config) == NULL) {
-                                               printk(KERN_ERR "%s: No Intersil ISL6423 found!\n", __func__);
+                                               pr_err("%s(): No Intersil ISL6423 found!\n", __func__);
                                                goto error_out;
                                        }
                                } else {
-                                       printk(KERN_ERR "%s: No STV6110(A) Silicon Tuner found!\n", __func__);
+                                       pr_err("%s(): No STV6110(A) Silicon Tuner found!\n", __func__);
                                        goto error_out;
                                }
                        }
                                                          STV090x_DEMODULATOR_0);
 
                        if (budget->dvb_frontend) {
-                               printk(KERN_INFO "budget: Omicom S2 detected\n");
+                               pr_info("Omicom S2 detected\n");
 
                                ctl = dvb_attach(stv6110x_attach,
                                                 budget->dvb_frontend,
                                                        &budget->i2c_adap,
                                                        LNBH24_PCL | LNBH24_TTX,
                                                        LNBH24_TEN, 0x14>>1) == NULL) {
-                                               printk(KERN_ERR
-                                               "No LNBH24 found!\n");
+                                               pr_err("No LNBH24 found!\n");
                                                goto error_out;
                                        }
                                } else {
-                                       printk(KERN_ERR "%s: No STV6110(A) Silicon Tuner found!\n", __func__);
+                                       pr_err("%s(): No STV6110(A) Silicon Tuner found!\n", __func__);
                                        goto error_out;
                                }
                        }
        }
 
        if (budget->dvb_frontend == NULL) {
-               printk("budget: A frontend driver was not found for device [%04x:%04x] subsystem [%04x:%04x]\n",
+               pr_err("A frontend driver was not found for device [%04x:%04x] subsystem [%04x:%04x]\n",
                       budget->dev->pci->vendor,
                       budget->dev->pci->device,
                       budget->dev->pci->subsystem_vendor,
        return;
 
 error_out:
-       printk("budget: Frontend registration failed!\n");
+       pr_err("Frontend registration failed!\n");
        dvb_frontend_detach(budget->dvb_frontend);
        budget->dvb_frontend = NULL;
 }
 
        err = ttpci_budget_init(budget, dev, info, THIS_MODULE, adapter_nr);
        if (err) {
-               printk("==> failed\n");
+               pr_err("==> failed\n");
                kfree(budget);
                return err;
        }
 
 #ifndef __BUDGET_DVB__
 #define __BUDGET_DVB__
 
+#ifdef pr_fmt
+#undef pr_fmt
+#endif
+
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <media/dvb_frontend.h>
 #include <media/dvbdev.h>
 #include <media/demux.h>
 #endif
 
 #define dprintk(level, fmt, arg...) do {                               \
-       if (level & budget_debug)                                       \
-               printk(KERN_DEBUG KBUILD_MODNAME ": %s(): " fmt,        \
-                      __func__, ##arg);                                \
+       if ((level) & budget_debug)                                     \
+               pr_info("%s(): " fmt, __func__, ##arg);                 \
 } while (0)
 
 #define TS_SIZE        188