hook_uninstall not working I have created a custom content-type in my custom module with custom fields.. It works fine.. But when I try to uninstall it, it doesnt call hook_unistall().. Can any one suggest what can be the problem ? 

Here is my code : 

function homepage_blocks_uninstall() {
    $sql = 'SELECT nid FROM {node} n WHERE n.type = :type';
    $result = db_query($sql, array(':type' =&gt; 'homepage_blocks'));

    //echo "hello";
    //exit;

    $nids = array();
    foreach ($result as $row) {
        $nids[] = $row-&gt;nid;
    }

    node_delete_multiple($nids);
    foreach (array_keys(_homepage_blocks_installed_fields()) as $field) {
        field_delete_field($field);
        //db_drop_table($field);
    }

    $instances = field_info_instances('node', 'homepage_blocks');
    foreach (_homepage_blocks_installed_instances() as $instance_name =&gt; $instance) {
        field_delete_instance($instance);
    }

    node_type_delete('homepage_blocks');
    field_purge_batch(1000);
    //variable_del('comment_homepage_blocks');
    //variable_del('node_submitted_homepage_blocks');
    drupal_flush_all_caches();
    //module_disable('homepage_blocks');
}


And I want to delete all tables, cache, variables node entries related to that module while uninstalling module so that I can re-install it.. What extra code I need ?

_homepage_blocks_installed_fields() and _homepage_blocks_installed_instances() are functions reside in homepage_blocks.functions.inc file and I have included this file to my homepage_blocks.module and homepage_blocks.install
Are the functions you are calling from your implementation of hook_uninstall() defined in your .module file? If that is the case, those functions will not be found, as the module file is not anymore loaded in memory.


  When hook_uninstall() is called, your module will already be disabled, so its .module file will not be automatically included. If you need to call API functions from your .module file in this hook, use drupal_load() to make them available. (Keep this usage to a minimum, though, especially when calling API functions that invoke hooks, or API functions from modules listed as dependencies, since these may not be available or work as expected when the module is disabled.)